Skip to content
Snippets Groups Projects
Commit 8431ee7a authored by Soeren Peters's avatar Soeren Peters
Browse files

Make deleted constructors public.

parent 2072e322
No related branches found
No related tags found
No related merge requests found
......@@ -36,8 +36,8 @@ public:
public:
UbFileOutput() : filename("") { }
UbFileOutput(const std::string& filename) : filename(filename), commentindicator('C') { }
virtual ~UbFileOutput() { outfile.flush();outfile.close(); }
UbFileOutput(const std::string& filename) : filename(filename) { }
virtual ~UbFileOutput() { outfile.flush(); }
virtual bool open(const std::string& filename, CREATEOPTION opt=OUTFILE) = 0;
......
......@@ -133,7 +133,7 @@ void UbFileOutputBinary::writeString(const string& value, const int& /*width*/)
/*==========================================================*/
void UbFileOutputBinary::writeStringOnly(const string& /*value*/)
{
UbException(UB_EXARGS,"no way... causes to many errors");
throw UbException(UB_EXARGS,"no way... causes to many errors"); // TODO: WTF?
}
/*==========================================================*/
void UbFileOutputBinary::writeLine(const std::string& value, const int& /*width*/)
......
......@@ -18,10 +18,10 @@ public:
return &instance;
}
WbWriterAvsASCII( const WbWriterAvsASCII& ) = delete;
const WbWriterAvsASCII& operator=( const WbWriterAvsASCII& ) = delete;
private:
WbWriterAvsASCII() : WbWriter() {}
WbWriterAvsASCII( const WbWriterAvsASCII& ) = delete; //no copy allowed
const WbWriterAvsASCII& operator=( const WbWriterAvsASCII& ) = delete; //no copy allowed
WbWriterAvsASCII() = default;
public:
std::string getFileExtension() override { return ".ascii.inp"; }
......
......@@ -17,10 +17,11 @@ public:
static WbWriterAvsBinary instance;
return &instance;
}
WbWriterAvsBinary( const WbWriterAvsBinary& ) = delete;
const WbWriterAvsBinary& operator=( const WbWriterAvsBinary& ) = delete;
private:
WbWriterAvsBinary() : WbWriter() {}
WbWriterAvsBinary( const WbWriterAvsBinary& ) = delete; //no copy allowed
const WbWriterAvsBinary& operator=( const WbWriterAvsBinary& ) = delete; //no copy allowed
WbWriterAvsBinary() = default;
public:
std::string getFileExtension() override { return ".bin.inp"; }
......
......@@ -13,6 +13,10 @@ public:
static WbWriterTecPlotASCII instance;
return &instance;
}
WbWriterTecPlotASCII( const WbWriterTecPlotASCII& ) = delete;
const WbWriterTecPlotASCII& operator=( const WbWriterTecPlotASCII& ) = delete;
private:
WbWriterTecPlotASCII() : WbWriter()
{
......@@ -21,9 +25,6 @@ private:
if(sizeof(float) !=4) throw UbException(UB_EXARGS,"machine error float type mismatch");
}
WbWriterTecPlotASCII( const WbWriterTecPlotASCII& ) = delete; //no copy allowed
const WbWriterTecPlotASCII& operator=( const WbWriterTecPlotASCII& ) = delete; //no copy allowed
static std::string pvdEndTag;
public:
std::string getFileExtension() override { return ".ascii.dat"; }
......
......@@ -17,10 +17,11 @@ public:
static WbWriterVtkBinary instance;
return &instance;
}
WbWriterVtkBinary( const WbWriterVtkBinary& ) = delete;
const WbWriterVtkBinary& operator=( const WbWriterVtkBinary& ) = delete;
private:
WbWriterVtkBinary() : WbWriter() {}
WbWriterVtkBinary( const WbWriterVtkBinary& ) = delete; //no copy allowed
const WbWriterVtkBinary& operator=( const WbWriterVtkBinary& ) = delete; //no copy allowed
WbWriterVtkBinary() = default;
public:
std::string getFileExtension() override { return ".bin.vtk"; }
......
......@@ -13,6 +13,9 @@ public:
static WbWriterX3D instance;
return &instance;
}
WbWriterX3D( const WbWriterX3D& ) = delete;
const WbWriterX3D& operator=( const WbWriterX3D& ) = delete;
private:
WbWriterX3D() : WbWriter()
{
......@@ -20,8 +23,6 @@ private:
if(sizeof(int) !=4) throw UbException(UB_EXARGS,"error int type mismatch");
if(sizeof(float) !=4) throw UbException(UB_EXARGS,"error float type mismatch");
}
WbWriterX3D( const WbWriterX3D& ) = delete; //no copy allowed
const WbWriterX3D& operator=( const WbWriterX3D& ) = delete; //no copy allowed
static std::string pvdEndTag;
......
......@@ -28,7 +28,7 @@ GbSphere3D::GbSphere3D(const double& x1,const double& x2, const double& x3, cons
}
/*=====================================================*/
GbSphere3D::GbSphere3D(const GbSphere3D& sphere)
: GbObject3D(), UbObserver()
: GbObject3D(sphere), UbObserver()
{
this->setName("sphere");
......
......@@ -547,7 +547,7 @@ UbTupleDouble6 GbTriangularMesh3D::calculateMomentOfInertia(double rhoP)
cout<<" top11:"<<top11<<" top22:"<<top22<<" top33:"<<top33<<endl;
cout<<" top12:"<<top12<<" top23:"<<top23<<" top13:"<<top13<<endl;
return UbTupleDouble6(top11,top22,top33,top12,top23,top13);
return {top11,top22,top33,top12,top23,top13};
}
/**
......@@ -1294,7 +1294,7 @@ char GbTriangularMesh3D::SegTriInt( GbTriangle3D* T, GbVector3D& q, GbVector3
int code = '?';
int m = -1;
code = SegPlaneInt( T, q, r, p, &m );
code = (unsigned char)SegPlaneInt( T, q, r, p, &m );
// printf("SegPlaneInt code=%c, m=%d; p=(%lf,%lf,%lf)\n", code,m,p[0],p[1],p[2]);
if ( code == '0') return '0';
......
......@@ -22,19 +22,11 @@ const float GbVoxelMatrix3D::FLUID = 0.0f;
// Konstruktor
GbVoxelMatrix3D::GbVoxelMatrix3D(int nx1, int nx2, int nx3, float initVal, double lowerThreshold, double upperThreshold)
: GbObject3D()
, minX1(0.0)
, minX2(0.0)
, minX3(0.0)
, lowerThreshold(lowerThreshold)
, upperThreshold(upperThreshold)
, nodesX1(nx1)
, nodesX2(nx2)
, nodesX3(nx3)
, deltaX1(1.0)
, deltaX2(1.0)
, deltaX3(1.0)
, transferViaFilename(false)
, addSurfaceTriangleSetFlag(true)
, voxelMatrix(Matrix3D(nx1, nx2, nx3, initVal))
{
this->setName("VoxelMatrix3D");
......@@ -49,30 +41,22 @@ GbVoxelMatrix3D::GbVoxelMatrix3D()
/*=======================================================*/
GbVoxelMatrix3D::GbVoxelMatrix3D(const Matrix3D& voxelMatrix, double lowerThreshold, double upperThreshold)
: GbObject3D()
, minX1(0.0)
, minX2(0.0)
, minX3(0.0)
, nodesX1((int)voxelMatrix.getNX1())
, nodesX2((int)voxelMatrix.getNX2())
, nodesX3((int)voxelMatrix.getNX3())
, lowerThreshold(lowerThreshold)
, upperThreshold(upperThreshold)
, deltaX1(1.0)
, deltaX2(1.0)
, deltaX3(1.0)
, transferViaFilename(false)
, addSurfaceTriangleSetFlag(true)
, voxelMatrix(voxelMatrix)
{
this->setName("VoxelMatrix3D");
}
/*=======================================================*/
GbVoxelMatrix3D* GbVoxelMatrix3D::clone()
GbVoxelMatrix3D* GbVoxelMatrix3D::clone()
{
GbVoxelMatrix3D* vm = new GbVoxelMatrix3D(this->voxelMatrix, lowerThreshold, upperThreshold);
GbVoxelMatrix3D* vm = new GbVoxelMatrix3D(voxelMatrix, lowerThreshold, upperThreshold);
vm->setVoxelMatrixMininum(minX1, minX2, minX3);
vm->setVoxelMatrixDelta(deltaX1, deltaX2, deltaX3);
return vm;
return vm;
}
/*=======================================================*/
void GbVoxelMatrix3D::setCenterCoordinates(const double& x1, const double& x2, const double& x3)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment