Mesh: PR6497 move return statement to new line
This commit is contained in:
@@ -789,7 +789,8 @@ bool MeshAlgorithm::FillupHole(const std::vector<PointIndex>& boundary,
|
||||
|
||||
void MeshAlgorithm::SetFacetsProperty(const std::vector<FacetIndex> &raulInds, const std::vector<unsigned long> &raulProps) const
|
||||
{
|
||||
if (raulInds.size() != raulProps.size()) return;
|
||||
if (raulInds.size() != raulProps.size())
|
||||
return;
|
||||
|
||||
std::vector<unsigned long>::const_iterator iP = raulProps.begin();
|
||||
for (std::vector<FacetIndex>::const_iterator i = raulInds.begin(); i != raulInds.end(); ++i, ++iP)
|
||||
|
||||
@@ -275,7 +275,8 @@ struct MeshFastBuilder::Private {
|
||||
}
|
||||
bool operator<(const Vertex& rhs) const
|
||||
{
|
||||
if (x != rhs.x) return x < rhs.x;
|
||||
if (x != rhs.x)
|
||||
return x < rhs.x;
|
||||
else if (y != rhs.y) return y < rhs.y;
|
||||
else if (z != rhs.z) return z < rhs.z;
|
||||
else return false;
|
||||
|
||||
@@ -301,7 +301,8 @@ struct MeshFacet_Less
|
||||
if (y1 > y2)
|
||||
{ tmp = y1; y1 = y2; y2 = tmp; }
|
||||
|
||||
if (x0 < y0) return true;
|
||||
if (x0 < y0)
|
||||
return true;
|
||||
else if (x0 > y0) return false;
|
||||
else if (x1 < y1) return true;
|
||||
else if (x1 > y1) return false;
|
||||
@@ -1065,7 +1066,9 @@ bool MeshEvalRangePoint::Evaluate()
|
||||
PointIndex ulCtPoints = _rclMesh.CountPoints();
|
||||
|
||||
for (MeshFacetArray::_TConstIterator it = rFaces.begin(); it != rFaces.end(); ++it) {
|
||||
if (std::find_if(it->_aulPoints, it->_aulPoints + 3, [ulCtPoints](PointIndex i) { return i >= ulCtPoints; }) < it->_aulPoints + 3)
|
||||
if (std::find_if(it->_aulPoints, it->_aulPoints + 3, [ulCtPoints](PointIndex i) {
|
||||
return i >= ulCtPoints;
|
||||
}) < it->_aulPoints + 3)
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1080,7 +1083,9 @@ std::vector<PointIndex> MeshEvalRangePoint::GetIndices() const
|
||||
|
||||
PointIndex ind=0;
|
||||
for (MeshFacetArray::_TConstIterator it = rFaces.begin(); it != rFaces.end(); ++it, ind++) {
|
||||
if (std::find_if(it->_aulPoints, it->_aulPoints + 3, [ulCtPoints](PointIndex i) { return i >= ulCtPoints; }) < it->_aulPoints + 3)
|
||||
if (std::find_if(it->_aulPoints, it->_aulPoints + 3, [ulCtPoints](PointIndex i) {
|
||||
return i >= ulCtPoints;
|
||||
}) < it->_aulPoints + 3)
|
||||
aInds.push_back(ind);
|
||||
}
|
||||
|
||||
|
||||
@@ -250,7 +250,8 @@ bool MeshInput::LoadSTL (std::istream &rstrIn)
|
||||
// the file size has only 134 bytes in this case. On the other hand we must overread the first 80 bytes
|
||||
// because it can happen that the file is binary but contains one of these keywords.
|
||||
std::streambuf* buf = rstrIn.rdbuf();
|
||||
if (!buf) return false;
|
||||
if (!buf)
|
||||
return false;
|
||||
buf->pubseekoff(80, std::ios::beg, std::ios::in);
|
||||
uint32_t ulCt, ulBytes=50;
|
||||
rstrIn.read((char*)&ulCt, sizeof(ulCt));
|
||||
|
||||
@@ -1406,7 +1406,8 @@ void MeshTopoAlgorithm::SplitNeighbourFacet(FacetIndex ulFacetPos, unsigned shor
|
||||
|
||||
bool MeshTopoAlgorithm::RemoveDegeneratedFacet(FacetIndex index)
|
||||
{
|
||||
if (index >= _rclMesh._aclFacetArray.size()) return false;
|
||||
if (index >= _rclMesh._aclFacetArray.size())
|
||||
return false;
|
||||
MeshFacet& rFace = _rclMesh._aclFacetArray[index];
|
||||
|
||||
// coincident corners (either topological or geometrical)
|
||||
@@ -1475,7 +1476,8 @@ bool MeshTopoAlgorithm::RemoveDegeneratedFacet(FacetIndex index)
|
||||
|
||||
bool MeshTopoAlgorithm::RemoveCorruptedFacet(FacetIndex index)
|
||||
{
|
||||
if (index >= _rclMesh._aclFacetArray.size()) return false;
|
||||
if (index >= _rclMesh._aclFacetArray.size())
|
||||
return false;
|
||||
MeshFacet& rFace = _rclMesh._aclFacetArray[index];
|
||||
|
||||
// coincident corners (topological)
|
||||
|
||||
@@ -383,13 +383,15 @@ bool EarClippingTriangulator::Triangulate::Snip(const std::vector<Base::Vector3f
|
||||
Cx = contour[V[w]].x;
|
||||
Cy = contour[V[w]].y;
|
||||
|
||||
if (FLOAT_EPS > (((Bx-Ax)*(Cy-Ay)) - ((By-Ay)*(Cx-Ax)))) return false;
|
||||
if (FLOAT_EPS > (((Bx-Ax)*(Cy-Ay)) - ((By-Ay)*(Cx-Ax))))
|
||||
return false;
|
||||
|
||||
for (p=0;p<n;p++) {
|
||||
if( (p == u) || (p == v) || (p == w) ) continue;
|
||||
Px = contour[V[p]].x;
|
||||
Py = contour[V[p]].y;
|
||||
if (InsideTriangle(Ax,Ay,Bx,By,Cx,Cy,Px,Py)) return false;
|
||||
if (InsideTriangle(Ax,Ay,Bx,By,Cx,Cy,Px,Py))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -403,7 +405,8 @@ bool EarClippingTriangulator::Triangulate::Process(const std::vector<Base::Vecto
|
||||
/* allocate and initialize list of Vertices in polygon */
|
||||
|
||||
int n = contour.size();
|
||||
if ( n < 3 ) return false;
|
||||
if ( n < 3 )
|
||||
return false;
|
||||
|
||||
int *V = new int[n];
|
||||
|
||||
@@ -604,7 +607,8 @@ struct Vertex2d_Less
|
||||
{
|
||||
if (fabs(p.x - q.x) < MeshDefinitions::_fMinPointDistanceD1) {
|
||||
if (fabs(p.y - q.y) < MeshDefinitions::_fMinPointDistanceD1) {
|
||||
return false; } else return p.y < q.y;
|
||||
return false;
|
||||
} else return p.y < q.y;
|
||||
} else return p.x < q.x;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -79,7 +79,8 @@ HarmonizeNormals::~HarmonizeNormals()
|
||||
App::DocumentObjectExecReturn *HarmonizeNormals::execute()
|
||||
{
|
||||
App::DocumentObject* link = Source.getValue();
|
||||
if (!link) return new App::DocumentObjectExecReturn("No mesh linked");
|
||||
if (!link)
|
||||
return new App::DocumentObjectExecReturn("No mesh linked");
|
||||
App::Property* prop = link->getPropertyByName("Mesh");
|
||||
if (prop && prop->getTypeId() == Mesh::PropertyMeshKernel::getClassTypeId()) {
|
||||
Mesh::PropertyMeshKernel* kernel = static_cast<Mesh::PropertyMeshKernel*>(prop);
|
||||
@@ -107,7 +108,8 @@ FlipNormals::~FlipNormals()
|
||||
App::DocumentObjectExecReturn *FlipNormals::execute()
|
||||
{
|
||||
App::DocumentObject* link = Source.getValue();
|
||||
if (!link) return new App::DocumentObjectExecReturn("No mesh linked");
|
||||
if (!link)
|
||||
return new App::DocumentObjectExecReturn("No mesh linked");
|
||||
App::Property* prop = link->getPropertyByName("Mesh");
|
||||
if (prop && prop->getTypeId() == Mesh::PropertyMeshKernel::getClassTypeId()) {
|
||||
Mesh::PropertyMeshKernel* kernel = static_cast<Mesh::PropertyMeshKernel*>(prop);
|
||||
@@ -135,7 +137,8 @@ FixNonManifolds::~FixNonManifolds()
|
||||
App::DocumentObjectExecReturn *FixNonManifolds::execute()
|
||||
{
|
||||
App::DocumentObject* link = Source.getValue();
|
||||
if (!link) return new App::DocumentObjectExecReturn("No mesh linked");
|
||||
if (!link)
|
||||
return new App::DocumentObjectExecReturn("No mesh linked");
|
||||
App::Property* prop = link->getPropertyByName("Mesh");
|
||||
if (prop && prop->getTypeId() == Mesh::PropertyMeshKernel::getClassTypeId()) {
|
||||
Mesh::PropertyMeshKernel* kernel = static_cast<Mesh::PropertyMeshKernel*>(prop);
|
||||
@@ -163,7 +166,8 @@ FixDuplicatedFaces::~FixDuplicatedFaces()
|
||||
App::DocumentObjectExecReturn *FixDuplicatedFaces::execute()
|
||||
{
|
||||
App::DocumentObject* link = Source.getValue();
|
||||
if (!link) return new App::DocumentObjectExecReturn("No mesh linked");
|
||||
if (!link)
|
||||
return new App::DocumentObjectExecReturn("No mesh linked");
|
||||
App::Property* prop = link->getPropertyByName("Mesh");
|
||||
if (prop && prop->getTypeId() == Mesh::PropertyMeshKernel::getClassTypeId()) {
|
||||
Mesh::PropertyMeshKernel* kernel = static_cast<Mesh::PropertyMeshKernel*>(prop);
|
||||
@@ -191,7 +195,8 @@ FixDuplicatedPoints::~FixDuplicatedPoints()
|
||||
App::DocumentObjectExecReturn *FixDuplicatedPoints::execute()
|
||||
{
|
||||
App::DocumentObject* link = Source.getValue();
|
||||
if (!link) return new App::DocumentObjectExecReturn("No mesh linked");
|
||||
if (!link)
|
||||
return new App::DocumentObjectExecReturn("No mesh linked");
|
||||
App::Property* prop = link->getPropertyByName("Mesh");
|
||||
if (prop && prop->getTypeId() == Mesh::PropertyMeshKernel::getClassTypeId()) {
|
||||
Mesh::PropertyMeshKernel* kernel = static_cast<Mesh::PropertyMeshKernel*>(prop);
|
||||
@@ -219,7 +224,8 @@ FixDegenerations::~FixDegenerations()
|
||||
App::DocumentObjectExecReturn *FixDegenerations::execute()
|
||||
{
|
||||
App::DocumentObject* link = Source.getValue();
|
||||
if (!link) return new App::DocumentObjectExecReturn("No mesh linked");
|
||||
if (!link)
|
||||
return new App::DocumentObjectExecReturn("No mesh linked");
|
||||
App::Property* prop = link->getPropertyByName("Mesh");
|
||||
if (prop && prop->getTypeId() == Mesh::PropertyMeshKernel::getClassTypeId()) {
|
||||
Mesh::PropertyMeshKernel* kernel = static_cast<Mesh::PropertyMeshKernel*>(prop);
|
||||
@@ -248,7 +254,8 @@ FixDeformations::~FixDeformations()
|
||||
App::DocumentObjectExecReturn *FixDeformations::execute()
|
||||
{
|
||||
App::DocumentObject* link = Source.getValue();
|
||||
if (!link) return new App::DocumentObjectExecReturn("No mesh linked");
|
||||
if (!link)
|
||||
return new App::DocumentObjectExecReturn("No mesh linked");
|
||||
App::Property* prop = link->getPropertyByName("Mesh");
|
||||
if (prop && prop->getTypeId() == Mesh::PropertyMeshKernel::getClassTypeId()) {
|
||||
Mesh::PropertyMeshKernel* kernel = static_cast<Mesh::PropertyMeshKernel*>(prop);
|
||||
@@ -278,7 +285,8 @@ FixIndices::~FixIndices()
|
||||
App::DocumentObjectExecReturn *FixIndices::execute()
|
||||
{
|
||||
App::DocumentObject* link = Source.getValue();
|
||||
if (!link) return new App::DocumentObjectExecReturn("No mesh linked");
|
||||
if (!link)
|
||||
return new App::DocumentObjectExecReturn("No mesh linked");
|
||||
App::Property* prop = link->getPropertyByName("Mesh");
|
||||
if (prop && prop->getTypeId() == Mesh::PropertyMeshKernel::getClassTypeId()) {
|
||||
Mesh::PropertyMeshKernel* kernel = static_cast<Mesh::PropertyMeshKernel*>(prop);
|
||||
@@ -308,7 +316,8 @@ FillHoles::~FillHoles()
|
||||
App::DocumentObjectExecReturn *FillHoles::execute()
|
||||
{
|
||||
App::DocumentObject* link = Source.getValue();
|
||||
if (!link) return new App::DocumentObjectExecReturn("No mesh linked");
|
||||
if (!link)
|
||||
return new App::DocumentObjectExecReturn("No mesh linked");
|
||||
App::Property* prop = link->getPropertyByName("Mesh");
|
||||
if (prop && prop->getTypeId() == Mesh::PropertyMeshKernel::getClassTypeId()) {
|
||||
Mesh::PropertyMeshKernel* kernel = static_cast<Mesh::PropertyMeshKernel*>(prop);
|
||||
@@ -339,7 +348,8 @@ RemoveComponents::~RemoveComponents()
|
||||
App::DocumentObjectExecReturn *RemoveComponents::execute()
|
||||
{
|
||||
App::DocumentObject* link = Source.getValue();
|
||||
if (!link) return new App::DocumentObjectExecReturn("No mesh linked");
|
||||
if (!link)
|
||||
return new App::DocumentObjectExecReturn("No mesh linked");
|
||||
App::Property* prop = link->getPropertyByName("Mesh");
|
||||
if (prop && prop->getTypeId() == Mesh::PropertyMeshKernel::getClassTypeId()) {
|
||||
Mesh::PropertyMeshKernel* kernel = static_cast<Mesh::PropertyMeshKernel*>(prop);
|
||||
|
||||
@@ -1454,7 +1454,9 @@ void MeshObject::removeSelfIntersections(const std::vector<FacetIndex>& indices)
|
||||
if (indices.size() % 2 != 0)
|
||||
return;
|
||||
unsigned long cntfacets = _kernel.CountFacets();
|
||||
if (std::find_if(indices.begin(), indices.end(), [cntfacets](FacetIndex v) { return v >= cntfacets; }) < indices.end())
|
||||
if (std::find_if(indices.begin(), indices.end(), [cntfacets](FacetIndex v) {
|
||||
return v >= cntfacets;
|
||||
}) < indices.end())
|
||||
return;
|
||||
std::vector<std::pair<FacetIndex, FacetIndex> > selfIntersections;
|
||||
std::vector<FacetIndex>::const_iterator it;
|
||||
|
||||
@@ -72,7 +72,8 @@ int MeshPy::PyInit(PyObject* args, PyObject*)
|
||||
try {
|
||||
this->parentProperty = nullptr;
|
||||
// if no mesh is given
|
||||
if (!pcObj) return 0;
|
||||
if (!pcObj)
|
||||
return 0;
|
||||
if (PyObject_TypeCheck(pcObj, &(MeshPy::Type))) {
|
||||
getMeshObjectPtr()->operator = (*static_cast<MeshPy*>(pcObj)->getMeshObjectPtr());
|
||||
}
|
||||
@@ -80,13 +81,15 @@ int MeshPy::PyInit(PyObject* args, PyObject*)
|
||||
PyObject* ret = addFacets(args);
|
||||
bool ok = (ret!=nullptr);
|
||||
Py_XDECREF(ret);
|
||||
if (!ok) return -1;
|
||||
if (!ok)
|
||||
return -1;
|
||||
}
|
||||
else if (PyTuple_Check(pcObj)) {
|
||||
PyObject* ret = addFacets(args);
|
||||
bool ok = (ret!=nullptr);
|
||||
Py_XDECREF(ret);
|
||||
if (!ok) return -1;
|
||||
if (!ok)
|
||||
return -1;
|
||||
}
|
||||
else if (PyUnicode_Check(pcObj)) {
|
||||
getMeshObjectPtr()->load(PyUnicode_AsUTF8(pcObj));
|
||||
|
||||
@@ -102,7 +102,8 @@ CmdMeshTransform::CmdMeshTransform()
|
||||
void CmdMeshTransform::activated(int)
|
||||
{
|
||||
unsigned int n = getSelection().countObjectsOfType(Mesh::Feature::getClassTypeId());
|
||||
if ( n!=1 ) return;
|
||||
if ( n!=1 )
|
||||
return;
|
||||
|
||||
std::string fName = getUniqueObjectName("Move");
|
||||
std::vector<Gui::SelectionSingleton::SelObj> cSel = getSelection().getSelection();
|
||||
@@ -141,7 +142,8 @@ CmdMeshDemolding::CmdMeshDemolding()
|
||||
void CmdMeshDemolding::activated(int)
|
||||
{
|
||||
unsigned int n = getSelection().countObjectsOfType(Mesh::Feature::getClassTypeId());
|
||||
if ( n!=1 ) return;
|
||||
if ( n!=1 )
|
||||
return;
|
||||
|
||||
std::string fName = getUniqueObjectName("Demolding");
|
||||
std::vector<Gui::SelectionSingleton::SelObj> cSel = getSelection().getSelection();
|
||||
@@ -608,7 +610,8 @@ void CmdMeshFromGeometry::activated(int)
|
||||
bool CmdMeshFromGeometry::isActive()
|
||||
{
|
||||
App::Document* doc = App::GetApplication().getActiveDocument();
|
||||
if (!doc) return false;
|
||||
if (!doc)
|
||||
return false;
|
||||
return getSelection().countObjectsOfType(App::GeoFeature::getClassTypeId()) >= 1;
|
||||
}
|
||||
|
||||
@@ -1647,7 +1650,8 @@ void CmdMeshFillupHoles::activated(int)
|
||||
bool ok;
|
||||
int FillupHolesOfLength = QInputDialog::getInt(Gui::getMainWindow(), QObject::tr("Fill holes"),
|
||||
QObject::tr("Fill holes with maximum number of edges:"), 3, 3, 10000, 1, &ok, Qt::MSWindowsFixedSizeDialogHint);
|
||||
if (!ok) return;
|
||||
if (!ok)
|
||||
return;
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Fill up holes"));
|
||||
for (std::vector<App::DocumentObject*>::const_iterator it = meshes.begin(); it != meshes.end(); ++it) {
|
||||
doCommand(Doc,"App.activeDocument().getObject(\"%s\").Mesh.fillupHoles(%d)"
|
||||
|
||||
@@ -163,7 +163,8 @@ Gui::View3DInventorViewer* MeshSelection::getViewer() const
|
||||
return ivViewer;
|
||||
|
||||
Gui::Document* doc = Gui::Application::Instance->activeDocument();
|
||||
if (!doc) return nullptr;
|
||||
if (!doc)
|
||||
return nullptr;
|
||||
Gui::MDIView* view = doc->getActiveView();
|
||||
if (view && view->getTypeId().isDerivedFrom(Gui::View3DInventor::getClassTypeId())) {
|
||||
Gui::View3DInventorViewer* viewer = static_cast<Gui::View3DInventor*>(view)->getViewer();
|
||||
|
||||
@@ -125,7 +125,8 @@ void RemoveComponents::on_cbDeselectComp_toggled(bool on)
|
||||
void RemoveComponents::deleteSelection()
|
||||
{
|
||||
Gui::Document* doc = Gui::Application::Instance->activeDocument();
|
||||
if (!doc) return;
|
||||
if (!doc)
|
||||
return;
|
||||
// delete all selected faces
|
||||
doc->openCommand(QT_TRANSLATE_NOOP("Command", "Delete selection"));
|
||||
bool ok = meshSel.deleteSelection();
|
||||
|
||||
@@ -909,7 +909,8 @@ void SoFCIndexedFaceSet::doAction(SoAction * action)
|
||||
{
|
||||
if (action->getTypeId() == Gui::SoGLSelectAction::getClassTypeId()) {
|
||||
SoNode* node = action->getNodeAppliedTo();
|
||||
if (!node) return; // on no node applied
|
||||
if (!node) // on no node applied
|
||||
return;
|
||||
|
||||
// The node we have is the parent of this node and the coordinate node
|
||||
// thus we search there for it.
|
||||
@@ -919,7 +920,8 @@ void SoFCIndexedFaceSet::doAction(SoAction * action)
|
||||
sa.setType(SoCoordinate3::getClassTypeId(), 1);
|
||||
sa.apply(node);
|
||||
SoPath * path = sa.getPath();
|
||||
if (!path) return;
|
||||
if (!path)
|
||||
return;
|
||||
|
||||
// make sure we got the node we wanted
|
||||
SoNode* coords = path->getNodeFromTail(0);
|
||||
@@ -931,7 +933,8 @@ void SoFCIndexedFaceSet::doAction(SoAction * action)
|
||||
}
|
||||
else if (action->getTypeId() == Gui::SoVisibleFaceAction::getClassTypeId()) {
|
||||
SoNode* node = action->getNodeAppliedTo();
|
||||
if (!node) return; // on no node applied
|
||||
if (!node) // on no node applied
|
||||
return;
|
||||
|
||||
// The node we have is the parent of this node and the coordinate node
|
||||
// thus we search there for it.
|
||||
@@ -941,7 +944,8 @@ void SoFCIndexedFaceSet::doAction(SoAction * action)
|
||||
sa.setType(SoCoordinate3::getClassTypeId(), 1);
|
||||
sa.apply(node);
|
||||
SoPath * path = sa.getPath();
|
||||
if (!path) return;
|
||||
if (!path)
|
||||
return;
|
||||
|
||||
// make sure we got the node we wanted
|
||||
SoNode* coords = path->getNodeFromTail(0);
|
||||
|
||||
@@ -114,7 +114,9 @@ SbBool SoSFMeshFacetArray::readValue(SoInput *in)
|
||||
}
|
||||
|
||||
value->resize(numtoread);
|
||||
if (!this->readBinaryValues(in, numtoread)) { return FALSE; }
|
||||
if (!this->readBinaryValues(in, numtoread)) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
// ** ASCII format *******************************************************
|
||||
@@ -135,7 +137,8 @@ SbBool SoSFMeshFacetArray::readValue(SoInput *in)
|
||||
// makeRoom() makes sure the allocation strategy is decent.
|
||||
if (currentidx >= value->size()) value->resize(currentidx + 1);
|
||||
|
||||
if (!this->read1Value(in, currentidx++)) return FALSE;
|
||||
if (!this->read1Value(in, currentidx++))
|
||||
return FALSE;
|
||||
|
||||
READ_VAL(c);
|
||||
if (c == ',') { READ_VAL(c); } // Treat trailing comma as whitespace.
|
||||
@@ -158,7 +161,8 @@ SbBool SoSFMeshFacetArray::readValue(SoInput *in)
|
||||
else {
|
||||
in->putBack(c);
|
||||
value->resize(1);
|
||||
if (!this->read1Value(in, 0)) return FALSE;
|
||||
if (!this->read1Value(in, 0))
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1046,7 +1050,8 @@ void SoFCMeshFaceSet::computeBBox(SoAction *action, SbBox3f &box, SbVec3f ¢e
|
||||
*/
|
||||
void SoFCMeshFaceSet::getPrimitiveCount(SoGetPrimitiveCountAction * action)
|
||||
{
|
||||
if (!this->shouldPrimitiveCount(action)) return;
|
||||
if (!this->shouldPrimitiveCount(action))
|
||||
return;
|
||||
SoState* state = action->getState();
|
||||
const MeshCore::MeshFacetArray * coordIndex = SoFCMeshFacetElement::get(state);
|
||||
action->addNumTriangles(coordIndex->size());
|
||||
@@ -1193,7 +1198,8 @@ void SoFCMeshOpenEdgeSet::computeBBox(SoAction *action, SbBox3f &box, SbVec3f &c
|
||||
*/
|
||||
void SoFCMeshOpenEdgeSet::getPrimitiveCount(SoGetPrimitiveCountAction * action)
|
||||
{
|
||||
if (!this->shouldPrimitiveCount(action)) return;
|
||||
if (!this->shouldPrimitiveCount(action))
|
||||
return;
|
||||
SoState* state = action->getState();
|
||||
const MeshCore::MeshFacetArray * rFaces = SoFCMeshFacetElement::get(state);
|
||||
|
||||
|
||||
@@ -566,7 +566,8 @@ void SoFCMeshNode::computeBBox(SoAction *action, SbBox3f &box, SbVec3f ¢er)
|
||||
*/
|
||||
void SoFCMeshNode::getPrimitiveCount(SoGetPrimitiveCountAction * action)
|
||||
{
|
||||
if (!this->shouldPrimitiveCount(action)) return;
|
||||
if (!this->shouldPrimitiveCount(action))
|
||||
return;
|
||||
action->addNumTriangles(countTriangles());
|
||||
}
|
||||
|
||||
@@ -591,7 +592,8 @@ void SoFCMeshNode::write( SoWriteAction* action )
|
||||
else if (out->getStage() == SoOutput::WRITE) {
|
||||
const MeshCore::MeshPointArray& rPoints = _mesh->getKernel().GetPoints();
|
||||
const MeshCore::MeshFacetArray& rFacets = _mesh->getKernel().GetFacets();
|
||||
if (this->writeHeader(out, FALSE, FALSE)) return;
|
||||
if (this->writeHeader(out, FALSE, FALSE))
|
||||
return;
|
||||
point.setNum(rPoints.size());
|
||||
unsigned int pos=0;
|
||||
for (MeshCore::MeshPointArray::_TConstIterator cP=rPoints.begin(); cP!=rPoints.end(); ++cP)
|
||||
@@ -744,7 +746,8 @@ void SoFCMeshOpenEdge::computeBBox(SoAction *action, SbBox3f &box, SbVec3f ¢
|
||||
*/
|
||||
void SoFCMeshOpenEdge::getPrimitiveCount(SoGetPrimitiveCountAction * action)
|
||||
{
|
||||
if (!this->shouldPrimitiveCount(action)) return;
|
||||
if (!this->shouldPrimitiveCount(action))
|
||||
return;
|
||||
|
||||
// Count number of open edges first
|
||||
int ctEdges=0;
|
||||
|
||||
@@ -634,7 +634,8 @@ void SoFCMeshObjectShape::GLRender(SoGLRenderAction *action)
|
||||
|
||||
SbBool mode = Gui::SoFCInteractiveElement::get(state);
|
||||
const Mesh::MeshObject * mesh = SoFCMeshObjectElement::get(state);
|
||||
if (!mesh || mesh->countPoints() == 0) return;
|
||||
if (!mesh || mesh->countPoints() == 0)
|
||||
return;
|
||||
|
||||
Binding mbind = this->findMaterialBinding(state);
|
||||
|
||||
@@ -974,7 +975,8 @@ void SoFCMeshObjectShape::doAction(SoAction * action)
|
||||
{
|
||||
if (action->getTypeId() == Gui::SoGLSelectAction::getClassTypeId()) {
|
||||
SoNode* node = action->getNodeAppliedTo();
|
||||
if (!node) return; // on no node applied
|
||||
if (!node) // on no node applied
|
||||
return;
|
||||
|
||||
// The node we have is the parent of this node and the coordinate node
|
||||
// thus we search there for it.
|
||||
@@ -984,7 +986,8 @@ void SoFCMeshObjectShape::doAction(SoAction * action)
|
||||
sa.setType(SoFCMeshObjectNode::getClassTypeId(), 1);
|
||||
sa.apply(node);
|
||||
SoPath * path = sa.getPath();
|
||||
if (!path) return;
|
||||
if (!path)
|
||||
return;
|
||||
|
||||
// make sure we got the node we wanted
|
||||
SoNode* coords = path->getNodeFromTail(0);
|
||||
@@ -1241,7 +1244,8 @@ void SoFCMeshObjectShape::computeBBox(SoAction *action, SbBox3f &box, SbVec3f &c
|
||||
*/
|
||||
void SoFCMeshObjectShape::getPrimitiveCount(SoGetPrimitiveCountAction * action)
|
||||
{
|
||||
if (!this->shouldPrimitiveCount(action)) return;
|
||||
if (!this->shouldPrimitiveCount(action))
|
||||
return;
|
||||
SoState* state = action->getState();
|
||||
const Mesh::MeshObject * mesh = SoFCMeshObjectElement::get(state);
|
||||
action->addNumTriangles(mesh->countFacets());
|
||||
@@ -1284,7 +1288,8 @@ void SoFCMeshSegmentShape::GLRender(SoGLRenderAction *action)
|
||||
|
||||
SbBool mode = Gui::SoFCInteractiveElement::get(state);
|
||||
const Mesh::MeshObject * mesh = SoFCMeshObjectElement::get(state);
|
||||
if (!mesh) return;
|
||||
if (!mesh)
|
||||
return;
|
||||
|
||||
Binding mbind = this->findMaterialBinding(state);
|
||||
|
||||
@@ -1652,7 +1657,8 @@ void SoFCMeshSegmentShape::computeBBox(SoAction *action, SbBox3f &box, SbVec3f &
|
||||
*/
|
||||
void SoFCMeshSegmentShape::getPrimitiveCount(SoGetPrimitiveCountAction * action)
|
||||
{
|
||||
if (!this->shouldPrimitiveCount(action)) return;
|
||||
if (!this->shouldPrimitiveCount(action))
|
||||
return;
|
||||
SoState* state = action->getState();
|
||||
const Mesh::MeshObject * mesh = SoFCMeshObjectElement::get(state);
|
||||
if (mesh && mesh->countSegments() > this->index.getValue()) {
|
||||
@@ -1684,7 +1690,8 @@ void SoFCMeshObjectBoundary::GLRender(SoGLRenderAction *action)
|
||||
{
|
||||
SoState* state = action->getState();
|
||||
const Mesh::MeshObject * mesh = SoFCMeshObjectElement::get(state);
|
||||
if (!mesh) return;
|
||||
if (!mesh)
|
||||
return;
|
||||
|
||||
SoMaterialBundle mb(action);
|
||||
SoTextureCoordinateBundle tb(action, true, false);
|
||||
@@ -1801,7 +1808,8 @@ void SoFCMeshObjectBoundary::computeBBox(SoAction *action, SbBox3f &box, SbVec3f
|
||||
*/
|
||||
void SoFCMeshObjectBoundary::getPrimitiveCount(SoGetPrimitiveCountAction * action)
|
||||
{
|
||||
if (!this->shouldPrimitiveCount(action)) return;
|
||||
if (!this->shouldPrimitiveCount(action))
|
||||
return;
|
||||
SoState* state = action->getState();
|
||||
const Mesh::MeshObject * mesh = SoFCMeshObjectElement::get(state);
|
||||
if (!mesh)
|
||||
|
||||
@@ -91,7 +91,9 @@ SbBool SoSFMeshPointArray::readValue(SoInput *in)
|
||||
}
|
||||
|
||||
value->resize(numtoread);
|
||||
if (!this->readBinaryValues(in, numtoread)) { return FALSE; }
|
||||
if (!this->readBinaryValues(in, numtoread)) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
// ** ASCII format *******************************************************
|
||||
@@ -112,7 +114,8 @@ SbBool SoSFMeshPointArray::readValue(SoInput *in)
|
||||
// makeRoom() makes sure the allocation strategy is decent.
|
||||
if (currentidx >= value->size()) value->resize(currentidx + 1);
|
||||
|
||||
if (!this->read1Value(in, currentidx++)) return FALSE;
|
||||
if (!this->read1Value(in, currentidx++))
|
||||
return FALSE;
|
||||
|
||||
READ_VAL(c);
|
||||
if (c == ',') { READ_VAL(c); } // Treat trailing comma as whitespace.
|
||||
@@ -135,7 +138,8 @@ SbBool SoSFMeshPointArray::readValue(SoInput *in)
|
||||
else {
|
||||
in->putBack(c);
|
||||
value->resize(1);
|
||||
if (!this->read1Value(in, 0)) return FALSE;
|
||||
if (!this->read1Value(in, 0))
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -81,9 +81,11 @@ void SoPolygon::GLRender(SoGLRenderAction *action)
|
||||
{
|
||||
SoState* state = action->getState();
|
||||
const SoCoordinateElement * coords = SoCoordinateElement::getInstance(state);
|
||||
if (!coords) return;
|
||||
if (!coords)
|
||||
return;
|
||||
const SbVec3f * points = coords->getArrayPtr3();
|
||||
if (!points) return;
|
||||
if (!points)
|
||||
return;
|
||||
|
||||
SoMaterialBundle mb(action);
|
||||
SoTextureCoordinateBundle tb(action, true, false);
|
||||
@@ -145,9 +147,11 @@ void SoPolygon::computeBBox(SoAction *action, SbBox3f &box, SbVec3f ¢er)
|
||||
{
|
||||
SoState* state = action->getState();
|
||||
const SoCoordinateElement * coords = SoCoordinateElement::getInstance(state);
|
||||
if (!coords) return;
|
||||
if (!coords)
|
||||
return;
|
||||
const SbVec3f * points = coords->getArrayPtr3();
|
||||
if (!points) return;
|
||||
if (!points)
|
||||
return;
|
||||
float maxX=-FLT_MAX, minX=FLT_MAX,
|
||||
maxY=-FLT_MAX, minY=FLT_MAX,
|
||||
maxZ=-FLT_MAX, minZ=FLT_MAX;
|
||||
|
||||
@@ -1260,8 +1260,10 @@ std::vector<Mesh::FacetIndex> ViewProviderMesh::getFacetsOfRegion(const SbViewpo
|
||||
void ViewProviderMesh::panCamera(SoCamera * cam, float aspectratio, const SbPlane & panplane,
|
||||
const SbVec2f & currpos, const SbVec2f & prevpos)
|
||||
{
|
||||
if (cam == nullptr) return; // can happen for empty scenegraph
|
||||
if (currpos == prevpos) return; // useless invocation
|
||||
if (cam == nullptr) // can happen for empty scenegraph
|
||||
return;
|
||||
if (currpos == prevpos) // useless invocation
|
||||
return;
|
||||
|
||||
|
||||
// Find projection points for the last and current mouse coordinates.
|
||||
|
||||
@@ -309,7 +309,8 @@ void ViewProviderMeshCurvature::updateData(const App::Property* prop)
|
||||
}
|
||||
else if (prop->getTypeId() == Mesh::PropertyCurvatureList::getClassTypeId()) {
|
||||
const Mesh::PropertyCurvatureList* curv = static_cast<const Mesh::PropertyCurvatureList*>(prop);
|
||||
if (curv->getSize() < 3) return; // invalid array
|
||||
if (curv->getSize() < 3) // invalid array
|
||||
return;
|
||||
#if 0 // FIXME: Do not always change the range
|
||||
init(curv); // init color bar
|
||||
#endif
|
||||
|
||||
@@ -258,7 +258,8 @@ std::vector<std::string> ViewProviderMeshNode::getDisplayModes(void) const
|
||||
|
||||
bool ViewProviderMeshNode::setEdit(int ModNum)
|
||||
{
|
||||
if ( m_bEdit ) return true;
|
||||
if ( m_bEdit )
|
||||
return true;
|
||||
m_bEdit = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user