Log in FemMesh view provider and some warnings fixed
This commit is contained in:
parent
fdc86819dd
commit
11b4abf24a
|
@ -64,7 +64,7 @@ public:
|
|||
bool operator > (const TimeInfo &time) const;
|
||||
|
||||
static const char* currentDateTimeString();
|
||||
static std::string diffTime(const TimeInfo &timeStart,const TimeInfo &timeEnd );
|
||||
static std::string diffTime(const TimeInfo &timeStart,const TimeInfo &timeEnd = TimeInfo());
|
||||
static float diffTimeF(const TimeInfo &timeStart,const TimeInfo &timeEnd );
|
||||
bool isNull() const;
|
||||
static TimeInfo null();
|
||||
|
|
|
@ -77,7 +77,7 @@ public:
|
|||
std::vector<std::vector<SelectionObject> > Result;
|
||||
|
||||
/// true if a valid filter is set
|
||||
bool isValid(void) const {return Ast;}
|
||||
bool isValid(void) const {return (bool) Ast;}
|
||||
|
||||
protected:
|
||||
std::string Filter;
|
||||
|
|
|
@ -36,6 +36,8 @@
|
|||
#include <Base/Stream.h>
|
||||
#include <Base/Exception.h>
|
||||
#include <Base/FileInfo.h>
|
||||
#include <Base/TimeInfo.h>
|
||||
#include <Base/Console.h>
|
||||
|
||||
#include <Mod/Mesh/App/Core/MeshKernel.h>
|
||||
#include <Mod/Mesh/App/Core/Evaluation.h>
|
||||
|
@ -374,6 +376,9 @@ void FemMesh::compute()
|
|||
|
||||
void FemMesh::readNastran(const std::string &Filename)
|
||||
{
|
||||
Base::TimeInfo Start;
|
||||
Base::Console().Log("Start: FemMesh::readNastran() =================================\n");
|
||||
|
||||
std::ifstream inputfile;
|
||||
inputfile.open(Filename.c_str());
|
||||
inputfile.seekg(std::ifstream::beg);
|
||||
|
@ -480,6 +485,8 @@ void FemMesh::readNastran(const std::string &Filename)
|
|||
while (inputfile.good());
|
||||
inputfile.close();
|
||||
|
||||
Base::Console().Log(" %f: File read, start building mesh\n",Base::TimeInfo::diffTimeF(Start,Base::TimeInfo()));
|
||||
|
||||
//Now fill the SMESH datastructure
|
||||
std::vector<Base::Vector3d>::const_iterator anodeiterator;
|
||||
SMESHDS_Mesh* meshds = this->myMesh->GetMeshDS();
|
||||
|
@ -524,6 +531,8 @@ void FemMesh::readNastran(const std::string &Filename)
|
|||
element_id[i]
|
||||
);
|
||||
}
|
||||
Base::Console().Log(" %f: Done \n",Base::TimeInfo::diffTimeF(Start,Base::TimeInfo()));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -53,6 +53,7 @@
|
|||
#include <Base/FileInfo.h>
|
||||
#include <Base/Stream.h>
|
||||
#include <Base/Console.h>
|
||||
#include <Base/TimeInfo.h>
|
||||
#include <sstream>
|
||||
|
||||
#include <SMESH_Mesh.hxx>
|
||||
|
@ -359,6 +360,7 @@ void ViewProviderFEMMeshBuilder::buildNodes(const App::Property* prop, std::vect
|
|||
|
||||
void ViewProviderFEMMeshBuilder::createMesh(const App::Property* prop, SoCoordinate3* coords, SoIndexedFaceSet* faces,bool ShowInner) const
|
||||
{
|
||||
|
||||
const Fem::PropertyFemMesh* mesh = static_cast<const Fem::PropertyFemMesh*>(prop);
|
||||
|
||||
SMESHDS_Mesh* data = const_cast<SMESH_Mesh*>(mesh->getValue().getSMesh())->GetMeshDS();
|
||||
|
@ -367,6 +369,10 @@ void ViewProviderFEMMeshBuilder::createMesh(const App::Property* prop, SoCoordin
|
|||
int numNodes = data->NbNodes();
|
||||
int numEdges = data->NbEdges();
|
||||
|
||||
if(numFaces+numNodes+numEdges == 0) return;
|
||||
Base::TimeInfo Start;
|
||||
Base::Console().Log("Start: ViewProviderFEMMeshBuilder::createMesh() =================================\n");
|
||||
|
||||
const SMDS_MeshInfo& info = data->GetMeshInfo();
|
||||
int numNode = info.NbNodes();
|
||||
int numTria = info.NbTriangles();
|
||||
|
@ -380,8 +386,10 @@ void ViewProviderFEMMeshBuilder::createMesh(const App::Property* prop, SoCoordin
|
|||
int numHedr = info.NbPolyhedrons();
|
||||
|
||||
|
||||
std::vector<FemFace> facesHelper(numTria+numQuad+numPoly+numTetr*4+numHexa*6+numPyrd*5+numPris*6);
|
||||
|
||||
|
||||
std::vector<FemFace> facesHelper(numTria+numQuad+numPoly+numTetr*4+numHexa*6+numPyrd*5+numPris*6);
|
||||
Base::Console().Log(" %f: Start build up %i face helper\n",Base::TimeInfo::diffTimeF(Start,Base::TimeInfo()),facesHelper.size());
|
||||
SMDS_VolumeIteratorPtr aVolIter = data->volumesIterator();
|
||||
for (int i=0;aVolIter->more();) {
|
||||
const SMDS_MeshVolume* aVol = aVolIter->next();
|
||||
|
@ -433,6 +441,8 @@ void ViewProviderFEMMeshBuilder::createMesh(const App::Property* prop, SoCoordin
|
|||
|
||||
int FaceSize = facesHelper.size();
|
||||
|
||||
Base::Console().Log(" %f: Start eliminate internal faces\n",Base::TimeInfo::diffTimeF(Start,Base::TimeInfo()));
|
||||
|
||||
// search for double (inside) faces and hide them
|
||||
if(!ShowInner){
|
||||
for(int l=0; l< FaceSize;l++){
|
||||
|
@ -445,6 +455,7 @@ void ViewProviderFEMMeshBuilder::createMesh(const App::Property* prop, SoCoordin
|
|||
}
|
||||
}
|
||||
}
|
||||
Base::Console().Log(" %f: Start build up node map\n",Base::TimeInfo::diffTimeF(Start,Base::TimeInfo()));
|
||||
|
||||
// sort out double nodes and build up index map
|
||||
std::map<const SMDS_MeshNode*, int> mapNodeIndex;
|
||||
|
@ -456,6 +467,7 @@ void ViewProviderFEMMeshBuilder::createMesh(const App::Property* prop, SoCoordin
|
|||
else
|
||||
break;
|
||||
}
|
||||
Base::Console().Log(" %f: Start set point vector\n",Base::TimeInfo::diffTimeF(Start,Base::TimeInfo()));
|
||||
|
||||
// set the point coordinates
|
||||
coords->point.setNum(mapNodeIndex.size());
|
||||
|
@ -468,6 +480,7 @@ void ViewProviderFEMMeshBuilder::createMesh(const App::Property* prop, SoCoordin
|
|||
coords->point.finishEditing();
|
||||
|
||||
|
||||
|
||||
// count triangle size
|
||||
int triangleCount=0;
|
||||
for(int l=0; l< FaceSize;l++)
|
||||
|
@ -479,6 +492,7 @@ void ViewProviderFEMMeshBuilder::createMesh(const App::Property* prop, SoCoordin
|
|||
default: assert(0);
|
||||
}
|
||||
|
||||
Base::Console().Log(" %f: Start build up triangle vector\n",Base::TimeInfo::diffTimeF(Start,Base::TimeInfo()));
|
||||
// set the triangle face indices
|
||||
faces->coordIndex.setNum(4*triangleCount);
|
||||
int index=0;
|
||||
|
@ -666,6 +680,7 @@ void ViewProviderFEMMeshBuilder::createMesh(const App::Property* prop, SoCoordin
|
|||
}
|
||||
|
||||
faces->coordIndex.finishEditing();
|
||||
Base::Console().Log(" %f: Finish =========================================================\n",Base::TimeInfo::diffTimeF(Start,Base::TimeInfo()));
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -416,7 +416,7 @@ float QuadraticFit::Fit()
|
|||
if (CountPoints() > 0) {
|
||||
std::vector< Wm4::Vector3<double> > cPts;
|
||||
GetMgcVectorArray( cPts );
|
||||
fResult = Wm4::QuadraticFit3<double>( CountPoints(), &(cPts[0]), _fCoeff );
|
||||
fResult = (float) Wm4::QuadraticFit3<double>( CountPoints(), &(cPts[0]), _fCoeff );
|
||||
_fLastResult = fResult;
|
||||
|
||||
_bIsFitted = true;
|
||||
|
@ -520,7 +520,7 @@ float SurfaceFit::Fit()
|
|||
float fResult = FLOAT_MAX;
|
||||
|
||||
if (CountPoints() > 0) {
|
||||
fResult = PolynomFit();
|
||||
fResult = (float) PolynomFit();
|
||||
_fLastResult = fResult;
|
||||
|
||||
_bIsFitted = true;
|
||||
|
@ -684,7 +684,7 @@ double SurfaceFit::Value(double x, double y) const
|
|||
float z = 0.0f;
|
||||
if (_bIsFitted) {
|
||||
FunctionContainer clFuncCont(_fCoeff);
|
||||
z = clFuncCont.F(x, y, 0.0f);
|
||||
z = (float) clFuncCont.F(x, y, 0.0f);
|
||||
}
|
||||
|
||||
return z;
|
||||
|
|
|
@ -413,7 +413,7 @@ public:
|
|||
Base::Vector3f GetGradient( double x, double y, double z ) const
|
||||
{
|
||||
Wm4::Vector3<double> grad = pImplSurf->GetGradient( Wm4::Vector3<double>(x, y, z) );
|
||||
return Base::Vector3f( grad.X(), grad.Y(), grad.Z() );
|
||||
return Base::Vector3f( (float)grad.X(), (float)grad.Y(), (float)grad.Z() );
|
||||
}
|
||||
|
||||
Base::Matrix4D GetHessian( double x, double y, double z ) const
|
||||
|
|
|
@ -488,7 +488,7 @@ void CmdPartDesignFillet::activated(int iMsg)
|
|||
|
||||
std::vector<std::string> SubNames = std::vector<std::string>(selection[0].getSubNames());
|
||||
|
||||
int i = 0;
|
||||
unsigned int i = 0;
|
||||
|
||||
while(i < SubNames.size())
|
||||
{
|
||||
|
@ -635,7 +635,7 @@ void CmdPartDesignChamfer::activated(int iMsg)
|
|||
|
||||
std::vector<std::string> SubNames = std::vector<std::string>(selection[0].getSubNames());
|
||||
|
||||
int i = 0;
|
||||
unsigned int i = 0;
|
||||
|
||||
while(i < SubNames.size())
|
||||
{
|
||||
|
@ -775,7 +775,7 @@ void CmdPartDesignDraft::activated(int iMsg)
|
|||
}
|
||||
|
||||
std::vector<std::string> SubNames = std::vector<std::string>(selection[0].getSubNames());
|
||||
int i = 0;
|
||||
unsigned int i = 0;
|
||||
|
||||
while(i < SubNames.size())
|
||||
{
|
||||
|
|
|
@ -370,7 +370,7 @@ void ViewProviderTransformed::recomputeFeature(void)
|
|||
|
||||
std::list<gp_Trsf> rejected_trsf = pcTransformed->getRejectedTransformations();
|
||||
std::list<gp_Trsf>::const_iterator trsf = rejected_trsf.begin();
|
||||
for (int i=0; i < rejected; i++,trsf++) {
|
||||
for (unsigned int i=0; i < rejected; i++,trsf++) {
|
||||
Base::Matrix4D mat;
|
||||
Part::TopoShape::convertToMatrix(*trsf,mat);
|
||||
mats[i] = convert(mat);
|
||||
|
|
|
@ -692,9 +692,9 @@ public:
|
|||
if (boost::math::isnan(arcAngle) || boost::math::isinf(arcAngle))
|
||||
arcAngle = 0.f;
|
||||
if (arcRadius >= 0 && arcAngle > 0)
|
||||
arcAngle -= 2*M_PI;
|
||||
arcAngle -= (float) 2*M_PI;
|
||||
if (arcRadius < 0 && arcAngle < 0)
|
||||
arcAngle += 2*M_PI;
|
||||
arcAngle += (float) 2*M_PI;
|
||||
endAngle = startAngle + arcAngle;
|
||||
|
||||
for (int i=1; i <= 29; i++) {
|
||||
|
@ -731,7 +731,7 @@ public:
|
|||
// here we check if there is a preselected point and
|
||||
// we set up a transition from the neighbouring segment.
|
||||
// (peviousCurve, previousPosId, dirVec, TransitionMode)
|
||||
for (int i=0; i < sugConstr1.size(); i++)
|
||||
for (unsigned int i=0; i < sugConstr1.size(); i++)
|
||||
if (sugConstr1[i].Type == Sketcher::Coincident) {
|
||||
const Part::Geometry *geom = sketchgui->getSketchObject()->getGeometry(sugConstr1[i].GeoId);
|
||||
if ((geom->getTypeId() == Part::GeomLineSegment::getClassTypeId() ||
|
||||
|
@ -844,7 +844,7 @@ public:
|
|||
if (sugConstr2.size() > 0) {
|
||||
// exclude any coincidence constraints
|
||||
std::vector<AutoConstraint> sugConstr;
|
||||
for (int i=0; i < sugConstr2.size(); i++) {
|
||||
for (unsigned int i=0; i < sugConstr2.size(); i++) {
|
||||
if (sugConstr2[i].Type != Sketcher::Coincident)
|
||||
sugConstr.push_back(sugConstr2[i]);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user