---
Checks: |
- -*,clang-diagnostic-*,clang-analyzer-*,modernize-use-override,modernize-use-nullptr,modernize-use-using,modernize-use-default-member-init,modernize-loop-convert,modernize-use-auto,modernize-redundant-void-arg,modernize-type-traits,modernize-use-bool-literals,modernize-use-equals-default,modernize-use-equals-delete,misc-include-cleaner,misc-const-correctness,misc-unused-parameters
+ -*,clang-diagnostic-*,clang-analyzer-*,modernize-use-override,modernize-use-nullptr,modernize-use-using,modernize-use-default-member-init,modernize-loop-convert,modernize-use-auto,modernize-redundant-void-arg,modernize-type-traits,modernize-use-bool-literals,modernize-use-equals-default,modernize-use-equals-delete,readability-isolate-declaration,misc-include-cleaner,misc-const-correctness,misc-unused-parameters
WarningsAsErrors: ''
HeaderFilterRegex: .*SHAPER.*
AnalyzeTemporaryDtors: false
value: '10'
- key: google-readability-namespace-comments.SpacesBeforeComments
value: '2'
+ - key: misc-const-corectness.WarnPointersAsValues
+ value: '1'
+ - key: misc-const-corectness.TransformPointersAsValues
+ value: '1'
- key: misc-unused-parameters.StrictMode
- value: '0'
+ value: '1'
- key: modernize-loop-convert.MaxCopySize
value: '16'
- key: modernize-loop-convert.MinConfidence
}
std::string aError;
- GeomShapePtr aFirstShape, aSecondShape;
+ GeomShapePtr aFirstShape;
+
+ GeomShapePtr aSecondShape;
if (!getShape(aFirstPointAttr, aFirstShape, aError) ||
!getShape(aSecondPointAttr, aSecondShape, aError)) {
setError(aError);
bool isReverseClosedCurve(const GeomEdgePtr &theEdge1,
const GeomEdgePtr &theEdge2) {
- std::list<GeomPointPtr> anEdge1Points, anEdge2Points;
+ std::list<GeomPointPtr> anEdge1Points;
+
+ std::list<GeomPointPtr> anEdge2Points;
edgePoints(theEdge1, anEdge1Points);
edgePoints(theEdge2, anEdge2Points);
void shiftStartPoint(GeomWirePtr &theWire, const GeomEdgePtr &theRefEdge,
const double theTolerance) {
if (!theWire->isClosed()) {
- GeomVertexPtr aV1, aV2;
+ GeomVertexPtr aV1;
+
+ GeomVertexPtr aV2;
GeomAlgoAPI_ShapeTools::findBounds(theWire, aV1, aV2);
if (aV1->point()->distance(aV2->point()) > theTolerance)
return;
// find closest vertex on the wire to the start point on the edge
GeomPointPtr aFirstRefPnt = theRefEdge->firstPoint();
- ListOfShape aBegin, aEnd;
+ ListOfShape aBegin;
+
+ ListOfShape aEnd;
double aMinDist = 1.e100;
for (GeomAPI_WireExplorer anExp(theWire); anExp.more(); anExp.next()) {
double aDist = anExp.currentVertex()->point()->distance(aFirstRefPnt);
isClosed ? false : (!string(USE_TANGENTS_ID())->value().empty());
// Get tangent for start and end points
- GeomDirPtr aDirStart, aDirEnd;
+ GeomDirPtr aDirStart;
+
+ GeomDirPtr aDirEnd;
if (isToUseTangents) {
aDirStart = selectionToDir(selection(TANGENT_START_ID()));
aDirEnd = selectionToDir(selection(TANGENT_END_ID()));
AttributeSelectionListPtr aSelectionList = selectionList(BASE_OBJECTS_ID());
// Collect base shapes.
- ListOfShape aShapes, aContexts;
+ ListOfShape aShapes;
+
+ ListOfShape aContexts;
getOriginalShapesAndContexts(BASE_OBJECTS_ID(), aShapes, aContexts);
// Collect sketch faces.
MapVertexWire aMapVW;
for (auto &aSketchEdge : aSketchEdges) {
GeomEdgePtr anEdge = aSketchEdge->edge();
- GeomVertexPtr aStartV, aEndV;
+ GeomVertexPtr aStartV;
+
+ GeomVertexPtr aEndV;
anEdge->vertices(aStartV, aEndV);
auto aFoundStart = aMapVW.find(aStartV);
auto aFoundEnd = aMapVW.find(aEndV);
if (theActionId == "split") {
DocumentPtr aDoc = document();
// collect all existing names of features to give unique names
- std::set<std::wstring> aFeatNames, aResNames;
+ std::set<std::wstring> aFeatNames;
+
+ std::set<std::wstring> aResNames;
std::list<FeaturePtr> allFeat = aDoc->allFeatures();
auto allFeatIter = allFeat.begin();
for (; allFeatIter != allFeat.end(); allFeatIter++) {
if (aSolution > 2) { // there may be several paths separated by ";" symbol
// LCOV_EXCL_START
std::string anEnvPart = anEnv;
- size_t aPosStart = 0, aPosEnd;
+ size_t aPosStart = 0;
+
+ size_t aPosEnd;
for (int aSubNum = 0; aSubNum < aSolution - 3; aSubNum++) {
aPosStart++;
aPosStart = anEnvPart.find(';', aPosStart);
} else if (aLineShape->isCompound()) {
// create an edge which covers all edges from compounds (they are on the
// same line)
- GeomPointPtr aFirst, aLast;
+ GeomPointPtr aFirst;
+
+ GeomPointPtr aLast;
GeomXYZPtr aLineVec;
for (GeomAPI_ShapeIterator anIt(aLineShape); anIt.more(); anIt.next()) {
GeomEdgePtr aSub = anIt.current()->edge();
(anAttrC.get() != nullptr) && (anAttrD.get() != nullptr) &&
anAttrA->isInitialized() && anAttrB->isInitialized() &&
anAttrC->isInitialized() && anAttrD->isInitialized()) {
- double aA = anAttrA->value(), aB = anAttrB->value(), aC = anAttrC->value(),
- aD = anAttrD->value();
+ double aA = anAttrA->value();
+
+ double aB = anAttrB->value();
+
+ double aC = anAttrC->value();
+
+ double aD = anAttrD->value();
std::shared_ptr<GeomAPI_Pln> aPlane =
std::shared_ptr<GeomAPI_Pln>(new GeomAPI_Pln(aA, aB, aC, aD));
double aSize = Config_PropManager::real(SKETCH_TAB_NAME, "planes_size");
aRes = GeomAlgoAPI_FaceBuilder::squareFace(
aNewPln, aSize > aDistance ? aSize : aDistance);
} else {
- std::shared_ptr<GeomAPI_Vertex> aV1, aV2;
+ std::shared_ptr<GeomAPI_Vertex> aV1;
+
+ std::shared_ptr<GeomAPI_Vertex> aV2;
GeomAlgoAPI_ShapeTools::findBounds(anEdge, aV1, aV2);
aRes = faceByThreeVertices(aV1, aV2, aVertex);
}
makeRectangularFace(const std::shared_ptr<GeomAPI_Face> theFace,
const std::shared_ptr<GeomAPI_Pln> thePln) {
// Create rectangular face close to the selected
- double aXmin, aYmin, Zmin, aXmax, aYmax, Zmax;
+ double aXmin;
+
+ double aYmin;
+
+ double Zmin;
+
+ double aXmax;
+
+ double aYmax;
+
+ double Zmax;
theFace->computeSize(aXmin, aYmin, Zmin, aXmax, aYmax, Zmax);
// use all 8 points of the bounding box to find the 2D bounds
bool isFirst = true;
- double aMinX2d = DBL_MAX, aMaxX2d = -DBL_MAX;
- double aMinY2d = DBL_MAX, aMaxY2d = -DBL_MAX;
+ double aMinX2d = DBL_MAX;
+
+ double aMaxX2d = -DBL_MAX;
+ double aMinY2d = DBL_MAX;
+
+ double aMaxY2d = -DBL_MAX;
for (int aXIsMin = 0; aXIsMin < 2; aXIsMin++) {
for (int aYIsMin = 0; aYIsMin < 2; aYIsMin++) {
for (int aZIsMin = 0; aZIsMin < 2; aZIsMin++) {
std::string aNewImageDir = theDumper.getDumpDir();
if (aResult.get() && aResult->hasTexture()) {
// get image data
- int aWidth, aHeight;
+ int aWidth;
+
+ int aHeight;
std::string aFormat;
std::list<unsigned char> aByteList;
AttributeImagePtr anImageAttr =
if (aFeaturesToExport.back()->getKind() == ExchangePlugin_ExportPart::ID())
aFeaturesToExport.pop_back();
- std::list<FeaturePtr> anExternalLinks, anExportedParts, aReferredParts;
+ std::list<FeaturePtr> anExternalLinks;
+
+ std::list<FeaturePtr> anExportedParts;
+
+ std::list<FeaturePtr> aReferredParts;
if (!verifyExport(aFeaturesToExport, anExternalLinks, anExportedParts,
aReferredParts)) {
if (!anExternalLinks.empty()) {
data()->setName(Locale::Convert::toWString(anObjectName));
ResultBodyPtr aResult = document()->createBody(data());
- bool anColorGroupSelected = false, anMaterialsGroupSelected = false;
+ bool anColorGroupSelected = false;
+
+ bool anMaterialsGroupSelected = false;
if (anExtension == "BREP" || anExtension == "BRP") {
aGeomShape = BREPImport(theFileName, anExtension, anError);
} else if (anExtension == "STEP" || anExtension == "STP") {
startPoint.variantType() != ModelHighAPI_Selection::VT_Empty &&
endPoint.variantType() != ModelHighAPI_Selection::VT_Empty;
- ModelHighAPI_Selection firstSel, secondSel;
+ ModelHighAPI_Selection firstSel;
+
+ ModelHighAPI_Selection secondSel;
ModelHighAPI_Double values[VEC_SIZE];
if (byAxis) {
firstSel = axis;
//==================================================================================================
void FeaturesPlugin_BooleanCommon::execute() {
ListOfShape aPlanes;
- GeomAPI_ShapeHierarchy anObjects, aTools;
+ GeomAPI_ShapeHierarchy anObjects;
+
+ GeomAPI_ShapeHierarchy aTools;
bool isSimpleMode = false;
//==================================================================================================
void FeaturesPlugin_BooleanCut::execute() {
- GeomAPI_ShapeHierarchy anObjects, aTools;
+ GeomAPI_ShapeHierarchy anObjects;
+
+ GeomAPI_ShapeHierarchy aTools;
ListOfShape aPlanes;
// Getting objects and tools
//=================================================================================================
void FeaturesPlugin_BooleanFill::execute() {
std::string anError;
- GeomAPI_ShapeHierarchy anObjects, aTools;
+ GeomAPI_ShapeHierarchy anObjects;
+
+ GeomAPI_ShapeHierarchy aTools;
ListOfShape aPlanes;
// Getting objects.
//==================================================================================================
void FeaturesPlugin_BooleanFuse::execute() {
std::string anError;
- GeomAPI_ShapeHierarchy anObjectsHierarchy, aToolsHierarchy;
+ GeomAPI_ShapeHierarchy anObjectsHierarchy;
+
+ GeomAPI_ShapeHierarchy aToolsHierarchy;
ListOfShape aPlanes;
bool isSimpleCreation = false;
!processAttribute(TOOL_LIST_ID(), aToolsHierarchy, aPlanes))
return;
- ListOfShape anObjects, aTools, anEdgesAndFaces;
+ ListOfShape anObjects;
+
+ ListOfShape aTools;
+
+ ListOfShape anEdgesAndFaces;
// all objects except edges and faces
anObjectsHierarchy.objectsByType(anEdgesAndFaces, anObjects,
GeomAPI_Shape::FACE, GeomAPI_Shape::EDGE);
// mark all subs of this parent as precessed to avoid handling twice
aParent = anObjectsHierarchy.parent(anObject);
- ListOfShape aUsed, aNotUsed;
+ ListOfShape aUsed;
+
+ ListOfShape aNotUsed;
anObjectsHierarchy.splitCompound(aParent, aUsed, aNotUsed);
aShapesToAdd.insert(aShapesToAdd.end(), aNotUsed.begin(), aNotUsed.end());
} else
//==================================================================================================
void FeaturesPlugin_BooleanSmash::execute() {
std::string anError;
- GeomAPI_ShapeHierarchy anObjectsHistory, aToolsHistory;
+ GeomAPI_ShapeHierarchy anObjectsHistory;
+
+ GeomAPI_ShapeHierarchy aToolsHistory;
ListOfShape aPlanes;
// Getting objects and tools.
if (aParent) {
anOriginalShapes.push_back(aParent);
- ListOfShape aUsed, aNotUsed;
+ ListOfShape aUsed;
+
+ ListOfShape aNotUsed;
anObjectsHistory.splitCompound(aParent, aUsed, aNotUsed);
aShapesToAdd.insert(aShapesToAdd.end(), aNotUsed.begin(), aNotUsed.end());
}
if (aShape && !aShape->isEqual(myShape)) {
- double aXmin, aXmax, aYmin, aYmax, aZmin, aZmax;
+ double aXmin;
+
+ double aXmax;
+
+ double aYmin;
+
+ double aYmax;
+
+ double aZmin;
+
+ double aZmax;
std::string anError;
if (!GetBoundingBox(aShape, aXmin, aXmax, aYmin, aYmax, aZmin, aZmax,
anError)) {
bool isDistDist =
aCreationMethod->value() == CREATION_METHOD_DISTANCE_DISTANCE();
- double aD1 = 0.0, aD2 = 0.0, aD = 0.0, anAngle = 0.0;
+ double aD1 = 0.0;
+
+ double aD2 = 0.0;
+
+ double aD = 0.0;
+
+ double anAngle = 0.0;
if (isDistDist) {
aD1 = real(FeaturesPlugin_Chamfer::D1_ID())->value();
aD2 = real(FeaturesPlugin_Chamfer::D2_ID())->value();
const ListOfShape &theTools, ListOfShape &theObjects,
ListOfMakeShape &theMakeShapes) {
// Getting objects.
- ListOfShape anObjects, anEdgesAndFaces, aCompSolids;
+ ListOfShape anObjects;
+
+ ListOfShape anEdgesAndFaces;
+
+ ListOfShape aCompSolids;
std::map<GeomShapePtr, ListOfShape> aCompSolidsObjects;
bool aCompoundsOnly = true; // if there are only compounds, do not use filler
// restoring compsolids
std::string anError;
std::vector<ModelAPI_Tools::ResultBaseAlgo> aResultBaseAlgoList;
- ListOfShape anOriginalShapesList, aResultShapesList;
+ ListOfShape anOriginalShapesList;
+
+ ListOfShape aResultShapesList;
for (auto &anIt : aBodiesAndFacesToRemove) {
GeomShapePtr aParent = anIt.first;
//=================================================================================================
void FeaturesPlugin_Extrusion::execute() {
- ListOfShape aBaseShapesList, aBoundaryShapes;
+ ListOfShape aBaseShapesList;
+
+ ListOfShape aBoundaryShapes;
ListOfMakeShape aMakeShapesList;
// Make extrusions.
bool isFixedRadius =
aCreationMethod->value() == CREATION_METHOD_SINGLE_RADIUS();
- double aRadius1 = 0.0, aRadius2 = 0.0;
+ double aRadius1 = 0.0;
+
+ double aRadius2 = 0.0;
if (isFixedRadius)
aRadius1 = real(RADIUS_ID())->value();
else {
// Consider the list of input shapes the same as the result, if
// * the total number of faces did NOT change.
- int nbInputFaces = 0, nbInputEdges = 0;
+ int nbInputFaces = 0;
+
+ int nbInputEdges = 0;
for (auto aShape : theInputs) {
if (aShape.get()) {
nbInputFaces += aShape->subShapes(GeomAPI_Shape::FACE, true).size();
}
}
- int nbResultFaces = 0, nbResultEdges = 0;
+ int nbResultFaces = 0;
+
+ int nbResultEdges = 0;
nbResultFaces = theResult->subShapes(GeomAPI_Shape::FACE, true).size();
nbResultEdges = theResult->subShapes(GeomAPI_Shape::EDGE, true).size();
return (0 < nbResultFaces &&
}
if (aShape && !aShape->isEqual(myShape)) {
- double aXmin, aXmax, aYmin, aYmax, aZmin, aZmax;
+ double aXmin;
+
+ double aXmax;
+
+ double aYmin;
+
+ double aYmax;
+
+ double aZmin;
+
+ double aZmax;
std::string anError;
if (!GetBoundingBox(aShape, aXmin, aXmax, aYmin, aYmax, aZmin, aZmax,
anError)) {
if (aFirstSelection->isInitialized() && aSecondelection->isInitialized()) {
- GeomShapePtr aFirstShape, aSecondShape;
+ GeomShapePtr aFirstShape;
+
+ GeomShapePtr aSecondShape;
if (aFirstSelection && aSecondelection) {
aFirstShape = aFirstSelection->value();
anObjectsSelList, isKeepSubShapes, anObjects, aParts, aTextureSource))
return;
- std::shared_ptr<GeomAPI_Dir> aFirstDir, aSecondDir;
- double aFirstStep, aSecondStep;
- int aFirstNbCopies, aSecondNbCopies;
+ std::shared_ptr<GeomAPI_Dir> aFirstDir;
+
+ std::shared_ptr<GeomAPI_Dir> aSecondDir;
+ double aFirstStep;
+
+ double aSecondStep;
+ int aFirstNbCopies;
+
+ int aSecondNbCopies;
if (!paramsAlongDirection(0, aFirstDir, aFirstStep, aFirstNbCopies))
return;
resizePlanes(anObjects.objects(), aPlanes, aMakeShapeList);
// cut unused solids of composolids from the objects of partition
- ListOfShape aTargetObjects, anUnusedSubs;
+ ListOfShape aTargetObjects;
+
+ ListOfShape anUnusedSubs;
std::string aError;
if (!cutSubs(anObjects, aTargetObjects, anUnusedSubs, aFuzzy, aMakeShapeList,
aError)) {
// compose a set of tools for the CUT operation:
// find the list of unused subs of the first argument or use itself
- ListOfShape aToolsForUsed, aToolsForUnused;
+ ListOfShape aToolsForUsed;
+
+ ListOfShape aToolsForUnused;
GeomShapePtr aFirstArgument = theHierarchy.parent(*anIt, false);
if (aFirstArgument &&
aFirstArgument->shapeType() == GeomAPI_Shape::COMPSOLID) {
// cut subs
bool isOk = true;
for (++anIt; anIt != theHierarchy.end() && isOk; ++anIt) {
- ListOfShape aUsed, aNotUsed;
+ ListOfShape aUsed;
+
+ ListOfShape aNotUsed;
GeomShapePtr aParent = theHierarchy.parent(*anIt, false);
if (aParent && aParent->shapeType() == GeomAPI_Shape::COMPSOLID) {
std::string aCreationMethod = string(CREATION_METHOD())->value();
// Getting base objects.
- ListOfShape aBaseShapesList, aBaseFacesList;
+ ListOfShape aBaseShapesList;
+
+ ListOfShape aBaseFacesList;
std::map<ResultConstructionPtr, ListOfShape> aSketchWiresMap;
AttributeSelectionListPtr aBaseObjectsSelectionList =
selectionList(BASE_OBJECTS_ID());
}
case GeomAPI_Shape::EDGE:
case GeomAPI_Shape::WIRE: {
- std::shared_ptr<GeomAPI_Vertex> aV1, aV2;
+ std::shared_ptr<GeomAPI_Vertex> aV1;
+
+ std::shared_ptr<GeomAPI_Vertex> aV2;
GeomAlgoAPI_ShapeTools::findBounds(theBaseShape, aV1, aV2);
- ListOfShape aV1History, aV2History;
+ ListOfShape aV1History;
+
+ ListOfShape aV2History;
thePipeAlgo->generated(aV1, aV1History);
thePipeAlgo->generated(aV2, aV2History);
if (!aV1History.empty()) {
}
case GeomAPI_Shape::EDGE:
case GeomAPI_Shape::WIRE: {
- std::shared_ptr<GeomAPI_Vertex> aV1, aV2;
+ std::shared_ptr<GeomAPI_Vertex> aV1;
+
+ std::shared_ptr<GeomAPI_Vertex> aV2;
GeomAlgoAPI_ShapeTools::findBounds(aBaseShape, aV1, aV2);
- ListOfShape aV1History, aV2History;
+ ListOfShape aV1History;
+
+ ListOfShape aV2History;
thePipeAlgo->generated(aV1, aV1History);
thePipeAlgo->generated(aV2, aV2History);
if (!aV1History.empty())
// Consider the list of input shapes the same as the result, if
// * both arguments have the same number of shells
// * the total number of faces in these shells did NOT change.
- int nbInputShells = 0, nbInputFaces = 0;
+ int nbInputShells = 0;
+
+ int nbInputFaces = 0;
for (auto aShape : theInputs) {
if (aShape.get()) {
if (aShape->isShell())
}
}
- int nbResultShells = 0, nbResultFaces = 0;
+ int nbResultShells = 0;
+
+ int nbResultFaces = 0;
if (theResult->isCompound()) {
ListOfShape shells = theResult->subShapes(GeomAPI_Shape::SHELL, true);
nbResultShells = shells.size();
aDir = anEdge->line()->direction();
// from/to shapes
- GeomShapePtr aFromShape, aToShape;
+ GeomShapePtr aFromShape;
+
+ GeomShapePtr aToShape;
aSelection = aFeature->selection(FeaturesPlugin_Extrusion::TO_OBJECT_ID());
if (aSelection.get()) {
aToShape = aSelection->value();
int anObjectsToolsNb[2] = {0, 0};
- auto anIt = theArguments.begin(), aLast = theArguments.end();
+ auto anIt = theArguments.begin();
+
+ auto aLast = theArguments.end();
bool isAllInSameCompSolid = true;
ResultBodyPtr aCompSolid;
std::shared_ptr<FeaturesPlugin_BooleanFuse> aFeature =
std::dynamic_pointer_cast<FeaturesPlugin_BooleanFuse>(theFeature);
- int anObjectsNb = 0, aToolsNb = 0;
+ int anObjectsNb = 0;
+
+ int aToolsNb = 0;
auto anIt = theArguments.begin();
std::shared_ptr<FeaturesPlugin_BooleanCommon> aFeature =
std::dynamic_pointer_cast<FeaturesPlugin_BooleanCommon>(theFeature);
- int anObjectsNb = 0, aToolsNb = 0;
+ int anObjectsNb = 0;
+
+ int aToolsNb = 0;
auto anIt = theArguments.begin();
if (!aFixPrs.IsNull()) {
Bnd_Box aBox;
BRepBndLib::Add(aShape, aBox);
- double aXmin, aXmax, aYmin, aYmax, aZmin, aZmax;
+ double aXmin;
+
+ double aXmax;
+
+ double aYmin;
+
+ double aYmax;
+
+ double aZmin;
+
+ double aZmax;
aBox.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
gp_Pnt aXYZ1(aXmin, aXmax, aYmin);
gp_Pnt aXYZ2(aXmax, aYmax, aZmax);
if (!anAIS.IsNull()) {
Handle(AIS_Shape) anAISShape = Handle(AIS_Shape)::DownCast(anAIS);
if (!anAISShape.IsNull()) {
- Standard_Real aCoefficient, aPreviousCoefficient;
+ Standard_Real aCoefficient;
+
+ Standard_Real aPreviousCoefficient;
anAISShape->OwnDeviationCoefficient(aCoefficient, aPreviousCoefficient);
if (fabs(aCoefficient - theDeflection) > Precision::Confusion()) {
isModified = true;
const auto &anEdge1 = theEdge1->impl<TopoDS_Edge>();
const auto &anEdge2 = theEdge2->impl<TopoDS_Edge>();
- double aF1, aL1;
+ double aF1;
+
+ double aL1;
Handle(Geom_Curve) aCurve1 = BRep_Tool::Curve(anEdge1, aF1, aL1);
- double aF2, aL2;
+ double aF2;
+
+ double aL2;
Handle(Geom_Curve) aCurve2 = BRep_Tool::Curve(anEdge2, aF2, aL2);
auto *anAngle = new AngleDirections;
bool isParallel = !aCenter;
if (isParallel)
aCenter = theStart1;
- std::shared_ptr<GeomAPI_Pnt2d> aPoint1, aPoint2;
+ std::shared_ptr<GeomAPI_Pnt2d> aPoint1;
+
+ std::shared_ptr<GeomAPI_Pnt2d> aPoint2;
if (isParallel)
aPoint1 = aPoint2 = theEnd1;
else {
GeomAPI_ProjectPointOnCurve aProj(aPoint, aCircle);
Standard_Integer aNbPoint = aProj.NbPoints();
if (aNbPoint > 0) {
- double aMinDistance = Precision::Infinite(), aDistance;
+ double aMinDistance = Precision::Infinite();
+
+ double aDistance;
for (Standard_Integer j = 1; j <= aNbPoint; j++) {
gp_Pnt aNewPoint = aProj.Point(j);
aDistance = aNewPoint.Distance(aPoint);
std::shared_ptr<GeomAPI_Vertex> &theStartVertex,
std::shared_ptr<GeomAPI_Vertex> &theEndVertex) const {
const auto &anEdge = impl<TopoDS_Edge>();
- TopoDS_Vertex aStart, aEnd;
+ TopoDS_Vertex aStart;
+
+ TopoDS_Vertex aEnd;
TopExp::Vertices(anEdge, aStart, aEnd);
theStartVertex.reset(new GeomAPI_Vertex);
theStartVertex->setImpl(new TopoDS_Vertex(aStart));
}
static Handle(Geom_Curve) baseCurve(const TopoDS_Edge &theEdge) {
- double aFirst, aLast;
+ double aFirst;
+
+ double aLast;
Handle(Geom_Curve) aCurve = BRep_Tool::Curve(theEdge, aFirst, aLast);
while (aCurve->IsKind(STANDARD_TYPE(Geom_TrimmedCurve))) {
Handle(Geom_TrimmedCurve) tc = Handle(Geom_TrimmedCurve)::DownCast(aCurve);
bool GeomAPI_Edge::isLine() const {
const auto &aShape = const_cast<GeomAPI_Edge *>(this)->impl<TopoDS_Shape>();
- double aFirst, aLast;
+ double aFirst;
+
+ double aLast;
Handle(Geom_Curve) aCurve =
BRep_Tool::Curve((const TopoDS_Edge &)aShape, aFirst, aLast);
if (aCurve.IsNull()) // degenerative edge
bool GeomAPI_Edge::isCircle() const {
const auto &aShape = const_cast<GeomAPI_Edge *>(this)->impl<TopoDS_Shape>();
- double aFirst, aLast;
+ double aFirst;
+
+ double aLast;
Handle(Geom_Curve) aCurve =
BRep_Tool::Curve((const TopoDS_Edge &)aShape, aFirst, aLast);
if (!circ(aCurve).IsNull()) {
bool GeomAPI_Edge::isArc() const {
const auto &aShape = const_cast<GeomAPI_Edge *>(this)->impl<TopoDS_Shape>();
- double aFirst, aLast;
+ double aFirst;
+
+ double aLast;
Handle(Geom_Curve) aCurve =
BRep_Tool::Curve((const TopoDS_Edge &)aShape, aFirst, aLast);
if (!circ(aCurve).IsNull()) {
bool GeomAPI_Edge::isEllipse() const {
const auto &aShape = const_cast<GeomAPI_Edge *>(this)->impl<TopoDS_Shape>();
- double aFirst, aLast;
+ double aFirst;
+
+ double aLast;
Handle(Geom_Curve) aCurve =
BRep_Tool::Curve((const TopoDS_Edge &)aShape, aFirst, aLast);
if (aCurve.IsNull()) // degenerative edge
bool GeomAPI_Edge::isBSpline() const {
const auto &aShape = const_cast<GeomAPI_Edge *>(this)->impl<TopoDS_Shape>();
- double aFirst, aLast;
+ double aFirst;
+
+ double aLast;
Handle(Geom_Curve) aCurve =
BRep_Tool::Curve((const TopoDS_Edge &)aShape, aFirst, aLast);
if (aCurve.IsNull()) // degenerative edge
std::shared_ptr<GeomAPI_Pnt> GeomAPI_Edge::firstPoint() {
const auto &aShape = const_cast<GeomAPI_Edge *>(this)->impl<TopoDS_Shape>();
- double aFirst, aLast;
+ double aFirst;
+
+ double aLast;
Handle(Geom_Curve) aCurve =
BRep_Tool::Curve((const TopoDS_Edge &)aShape, aFirst, aLast);
gp_Pnt aPoint;
std::shared_ptr<GeomAPI_Pnt> GeomAPI_Edge::lastPoint() {
const auto &aShape = const_cast<GeomAPI_Edge *>(this)->impl<TopoDS_Shape>();
- double aFirst, aLast;
+ double aFirst;
+
+ double aLast;
Handle(Geom_Curve) aCurve =
BRep_Tool::Curve((const TopoDS_Edge &)aShape, aFirst, aLast);
gp_Pnt aPoint;
std::shared_ptr<GeomAPI_Circ> GeomAPI_Edge::circle() const {
const auto &aShape = const_cast<GeomAPI_Edge *>(this)->impl<TopoDS_Shape>();
- double aFirst, aLast;
+ double aFirst;
+
+ double aLast;
Handle(Geom_Curve) aCurve =
BRep_Tool::Curve((const TopoDS_Edge &)aShape, aFirst, aLast);
Handle(Geom_Circle) aCirc = circ(aCurve);
std::shared_ptr<GeomAPI_Ellipse> GeomAPI_Edge::ellipse() const {
const auto &aShape = const_cast<GeomAPI_Edge *>(this)->impl<TopoDS_Shape>();
- double aFirst, aLast;
+ double aFirst;
+
+ double aLast;
Handle(Geom_Curve) aCurve =
BRep_Tool::Curve((const TopoDS_Edge &)aShape, aFirst, aLast);
if (!aCurve.IsNull()) {
std::shared_ptr<GeomAPI_Lin> GeomAPI_Edge::line() const {
const auto &aShape = const_cast<GeomAPI_Edge *>(this)->impl<TopoDS_Shape>();
- double aFirst, aLast;
+ double aFirst;
+
+ double aLast;
Handle(Geom_Curve) aCurve =
BRep_Tool::Curve((const TopoDS_Edge &)aShape, aFirst, aLast);
if (aCurve) {
if (aMyShape.ShapeType() != aInShape.ShapeType())
return false;
- double aMyStart, aMyEnd;
+ double aMyStart;
+
+ double aMyEnd;
Handle(Geom_Curve) aMyCurve =
BRep_Tool::Curve(TopoDS::Edge(aMyShape), aMyStart, aMyEnd);
- double aInStart, aInEnd;
+ double aInStart;
+
+ double aInEnd;
Handle(Geom_Curve) aInCurve =
BRep_Tool::Curve(TopoDS::Edge(aInShape), aInStart, aInEnd);
void GeomAPI_Edge::setRange(const double &theFirst, const double &theLast) {
TopoDS_Edge anEdge = impl<TopoDS_Edge>();
- double aFirst, aLast;
+ double aFirst;
+
+ double aLast;
Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, aFirst, aLast);
double aTolerance = BRep_Tool::Tolerance(anEdge);
if (aCurve->DynamicType() == STANDARD_TYPE(Geom_TrimmedCurve)) {
// LCOV_EXCL_START
bool GeomAPI_Edge::isInPlane(std::shared_ptr<GeomAPI_Pln> thePlane) const {
- double aFirst, aLast;
+ double aFirst;
+
+ double aLast;
const auto &aShape = const_cast<GeomAPI_Edge *>(this)->impl<TopoDS_Shape>();
Handle(Geom_Curve) aCurve =
BRep_Tool::Curve((const TopoDS_Edge &)aShape, aFirst, aLast);
if (aCurve.IsNull())
return false;
- double A, B, C, D;
+ double A;
+
+ double B;
+
+ double C;
+
+ double D;
thePlane->coefficients(A, B, C, D);
gp_Pln aPlane(A, B, C, D);
void GeomAPI_Edge::intersectWithPlane(
const std::shared_ptr<GeomAPI_Pln> thePlane,
std::list<std::shared_ptr<GeomAPI_Pnt>> &theResult) const {
- double aFirst, aLast;
+ double aFirst;
+
+ double aLast;
const auto &aShape = const_cast<GeomAPI_Edge *>(this)->impl<TopoDS_Shape>();
Handle(Geom_Curve) aCurve =
BRep_Tool::Curve((const TopoDS_Edge &)aShape, aFirst, aLast);
if (!aCurve.IsNull()) {
- double A, B, C, D;
+ double A;
+
+ double B;
+
+ double C;
+
+ double D;
thePlane->coefficients(A, B, C, D);
gp_Pln aPln(A, B, C, D);
Handle(Geom_Plane) aPlane = new Geom_Plane(aPln);
if (anExtrema.NbExtrema() > 0 && !anExtrema.Extrema().IsParallel() &&
anExtrema.LowerDistance() < aTolerance) {
// distance is lower than tolerance => tangent case
- gp_Pnt aPntC, aPntS;
+ gp_Pnt aPntC;
+
+ gp_Pnt aPntS;
anExtrema.NearestPoints(aPntC, aPntS);
std::shared_ptr<GeomAPI_Pnt> aPntPtr(
new GeomAPI_Pnt(aPntS.X(), aPntS.Y(), aPntS.Z()));
const auto &aShape = const_cast<GeomAPI_Edge *>(this)->impl<TopoDS_Shape>();
if (aShape.IsNull())
return false;
- double aFirst, aLast;
+ double aFirst;
+
+ double aLast;
Handle(Geom_Curve) aCurve =
BRep_Tool::Curve((const TopoDS_Edge &)aShape, aFirst, aLast);
if (aCurve.IsNull() || !aCurve->IsPeriodic())
void GeomAPI_Edge::setFirstPointTolerance(const double theTolerance) {
TopoDS_Edge anEdge = impl<TopoDS_Edge>();
- TopoDS_Vertex aVFirst, aVLast;
+ TopoDS_Vertex aVFirst;
+
+ TopoDS_Vertex aVLast;
TopExp::Vertices(anEdge, aVFirst, aVLast);
BRep_Builder().UpdateVertex(aVFirst, theTolerance);
}
void GeomAPI_Edge::setLastPointTolerance(const double theTolerance) {
TopoDS_Edge anEdge = impl<TopoDS_Edge>();
- TopoDS_Vertex aVFirst, aVLast;
+ TopoDS_Vertex aVFirst;
+
+ TopoDS_Vertex aVLast;
TopExp::Vertices(anEdge, aVFirst, aVLast);
BRep_Builder().UpdateVertex(aVLast, theTolerance);
}
double GeomAPI_Edge::firstPointTolerance() const {
TopoDS_Edge anEdge = impl<TopoDS_Edge>();
- TopoDS_Vertex aVFirst, aVLast;
+ TopoDS_Vertex aVFirst;
+
+ TopoDS_Vertex aVLast;
TopExp::Vertices(anEdge, aVFirst, aVLast);
return BRep_Tool::Tolerance(aVFirst);
}
double GeomAPI_Edge::lastPointTolerance() const {
TopoDS_Edge anEdge = impl<TopoDS_Edge>();
- TopoDS_Vertex aVFirst, aVLast;
+ TopoDS_Vertex aVFirst;
+
+ TopoDS_Vertex aVLast;
TopExp::Vertices(anEdge, aVFirst, aVLast);
return BRep_Tool::Tolerance(aVLast);
}
const auto &anEdge = impl<TopoDS_Edge>();
if (anEdge.IsNull())
return aMiddlePoint;
- double aFirst, aLast;
+ double aFirst;
+
+ double aLast;
Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, aFirst, aLast);
if (aCurve.IsNull())
return aMiddlePoint;
thePoint1 = GeomPnt2dPtr(new GeomAPI_Pnt2d(anInterPnt.X(), anInterPnt.Y()));
thePoint2 = GeomPnt2dPtr(new GeomAPI_Pnt2d(anInterPnt.X(), anInterPnt.Y()));
} else if (theExtremaAlgo->IsDone() && theExtremaAlgo->NbExt() > 0) {
- Extrema_POnCurv2d aP1, aP2;
+ Extrema_POnCurv2d aP1;
+
+ Extrema_POnCurv2d aP2;
for (int i = 1; i <= theExtremaAlgo->NbExt(); ++i) {
double aSqDist = theExtremaAlgo->SquareDistance(i);
if (aSqDist < aDistance) {
return false;
// Get parameters of surfaces
- double aMyUMin, aMyUMax, aMyVMin, aMyVMax;
+ double aMyUMin;
+
+ double aMyUMax;
+
+ double aMyVMin;
+
+ double aMyVMax;
aMySurf->Bounds(aMyUMin, aMyUMax, aMyVMin, aMyVMax);
- double aInUMin, aInUMax, aInVMin, aInVMax;
+ double aInUMin;
+
+ double aInUMax;
+
+ double aInVMin;
+
+ double aInVMax;
aInSurf->Bounds(aInUMin, aInUMax, aInVMin, aInVMax);
// Check that parameters are the same
}
if (isPlanar) {
- double aA, aB, aC, aD;
+ double aA;
+
+ double aB;
+
+ double aC;
+
+ double aD;
aPln.Coefficients(aA, aB, aC, aD);
if (aFace.Orientation() == TopAbs_REVERSED) {
aA = -aA;
const gp_Dir &aDir = aCyl.Position().Direction();
double aRadius = aCyl.Radius();
- double aUMin, aUMax, aVMin, aVMax;
+ double aUMin;
+
+ double aUMax;
+
+ double aVMin;
+
+ double aVMax;
BRepTools::UVBounds(aFace, aUMin, aUMax, aVMin, aVMax);
double aHeight = aVMax - aVMin;
gp_Pnt aLoc = aCon.Location();
gp_Dir aDir = aCon.Position().Direction();
- double aUMin, aUMax, aVMin, aVMax;
+ double aUMin;
+
+ double aUMax;
+
+ double aVMin;
+
+ double aVMax;
BRepTools::UVBounds(aFace, aUMin, aUMax, aVMin, aVMax);
double aSemiAngle = Abs(aCon.SemiAngle());
if (aFace.IsNull())
return anInnerPoint;
- double aUMin, aUMax, aVMin, aVMax;
+ double aUMin;
+
+ double aUMax;
+
+ double aVMin;
+
+ double aVMax;
optimalBounds(aFace, aUMin, aUMax, aVMin, aVMax);
Handle(Geom_Surface) aSurf = BRep_Tool::Surface(aFace);
void optimalBounds(const TopoDS_Face &theFace, const TopoDS_Edge &theEdge,
Bnd_Box2d &theBndBox) {
- Standard_Real aFirst, aLast;
+ Standard_Real aFirst;
+
+ Standard_Real aLast;
const Handle(Geom2d_Curve) aC2D =
BRep_Tool::CurveOnSurface(theEdge, theFace, aFirst, aLast);
if (aC2D.IsNull())
return;
- Standard_Real aXmin = 0.0, aYmin = 0.0, aXmax = 0.0, aYmax = 0.0;
- Standard_Real aUmin, aUmax, aVmin, aVmax;
- Bnd_Box2d aBoxC, aBoxS;
+ Standard_Real aXmin = 0.0;
+
+ Standard_Real aYmin = 0.0;
+
+ Standard_Real aXmax = 0.0;
+
+ Standard_Real aYmax = 0.0;
+ Standard_Real aUmin;
+
+ Standard_Real aUmax;
+
+ Standard_Real aVmin;
+
+ Standard_Real aVmax;
+ Bnd_Box2d aBoxC;
+
+ Bnd_Box2d aBoxS;
BndLib_Add2dCurve::AddOptimal(aC2D, aFirst, aLast, 0., aBoxC);
if (aBoxC.IsVoid())
return;
(aXmin < aUmin || aXmax > aUmax)) {
Standard_Real aTol2 = 100 * Precision::SquareConfusion();
isUPeriodic = Standard_True;
- gp_Pnt P1, P2;
+ gp_Pnt P1;
+
+ gp_Pnt P2;
// 1. Verify that the surface is U-closed
if (!aS->IsUClosed()) {
Standard_Real aVStep = aVmax - aVmin;
(aYmin < aVmin || aYmax > aVmax)) {
Standard_Real aTol2 = 100 * Precision::SquareConfusion();
isVPeriodic = Standard_True;
- gp_Pnt P1, P2;
+ gp_Pnt P1;
+
+ gp_Pnt P2;
// 1. Verify that the surface is V-closed
if (!aS->IsVClosed()) {
Standard_Real aUStep = aUmax - aUmin;
std::shared_ptr<GeomAPI_Pnt2d>
GeomAPI_Pnt::to2D(const std::shared_ptr<GeomAPI_Pln> &thePln) const {
- double aA, aB, aC, aD;
+ double aA;
+
+ double aB;
+
+ double aC;
+
+ double aD;
thePln->coefficients(aA, aB, aC, aD);
gp_Pln aPln(aA, aB, aC, aD);
if (theShape.ShapeType() != TopAbs_EDGE)
return false;
- Standard_Real aFirst, aLast;
+ Standard_Real aFirst;
+
+ Standard_Real aLast;
Handle(Geom_Curve) aCurve =
BRep_Tool::Curve(TopoDS::Edge(theShape), aFirst, aLast);
Handle(Standard_Type) aType = aCurve->DynamicType();
break;
default: {
// get middle point as center of the bounding box
- double aMinX, aMinY, aMinZ, aMaxX, aMaxY, aMaxZ;
+ double aMinX;
+
+ double aMinY;
+
+ double aMinZ;
+
+ double aMaxX;
+
+ double aMaxY;
+
+ double aMaxZ;
computeSize(aMinX, aMinY, aMinZ, aMaxX, aMaxY, aMaxZ);
aMiddlePoint = GeomPointPtr(new GeomAPI_Pnt(
(aMinX + aMaxX) * 0.5, (aMinY + aMaxY) * 0.5, (aMinZ + aMaxZ) * 0.5));
SetOfShape aProcessed = myProcessedObjects;
aThis->myProcessedObjects.clear();
- iterator anIt = aThis->begin(), aEnd = aThis->end();
+ iterator anIt = aThis->begin();
+
+ iterator aEnd = aThis->end();
for (; anIt != aEnd; ++anIt) {
GeomShapePtr aShape = *anIt;
GeomShapePtr aRoot = aThis->root(aShape);
GeomPointPtr anApex;
GeomDirPtr anAxis;
- double aSemiAngle = 0.0, aTanSemiAngle = 0.0;
- double aHeight1 = 0.0, aHeight2 = 0.0;
+ double aSemiAngle = 0.0;
+
+ double aTanSemiAngle = 0.0;
+ double aHeight1 = 0.0;
+
+ double aHeight2 = 0.0;
for (TopExp_Explorer anExp(impl<TopoDS_Shape>(), TopAbs_FACE); anExp.More();
anExp.Next()) {
for (BRepTools_WireExplorer anExp(aWire); anExp.More() && isPolygon;
anExp.Next()) {
const TopoDS_Edge &anEdge = anExp.Current();
- double aT1, aT2;
+ double aT1;
+
+ double aT2;
Handle(Geom_Curve) aC3D = BRep_Tool::Curve(anEdge, aT1, aT2);
if (!aC3D.IsNull() && aC3D->IsKind(aLineType)) {
gp_Pnt aCorner = BRep_Tool::Pnt(anExp.CurrentVertex());
for (BRepTools_WireExplorer anExp(aWire); anExp.More(); anExp.Next()) {
const TopoDS_Edge &anEdge = anExp.Current();
- double aT1, aT2;
+ double aT1;
+
+ double aT2;
Handle(Geom_Curve) aC3D = BRep_Tool::Curve(anEdge, aT1, aT2);
if (aC3D.IsNull())
continue;
const GeomShapePtr theObject, const GeomShapePtr theTool,
const GeomAlgoAPI_Tools::BOPType theOperationType,
const double theFuzzy /*= -1*/) {
- ListOfShape aListWithObject, aListWithTool;
+ ListOfShape aListWithObject;
+
+ ListOfShape aListWithTool;
aListWithObject.push_back(theObject);
aListWithTool.push_back(theTool);
build(aListWithObject, aListWithTool, theOperationType, theFuzzy);
}
// non solid case or any periodic surface (Mantis 22454).
- double U1, U2, V1, V2;
+ double U1;
+
+ double U2;
+
+ double V1;
+
+ double V2;
// changes for 0020677: EDF 1219 GEOM: MinDistance gives 0 instead
// of 20.88
// S->Bounds(U1,U2,V1,V2); changed by
BRepExtrema_DistShapeShape dst(tmpSh1, tmpSh2);
if (dst.IsDone()) {
double MinDist = 1.e9;
- gp_Pnt PMin1, PMin2, P1, P2;
+ gp_Pnt PMin1;
+
+ gp_Pnt PMin2;
+
+ gp_Pnt P1;
+
+ gp_Pnt P2;
for (int i = 1; i <= dst.NbSolution(); i++) {
P1 = dst.PointOnShape1(i);
P2 = dst.PointOnShape2(i);
// Make GetMinDistance() return zero if a sole VERTEX is inside any of SOLIDs
// which of shapes consists of only one vertex?
- TopExp_Explorer exp1(theShape1, TopAbs_VERTEX),
- exp2(theShape2, TopAbs_VERTEX);
+ TopExp_Explorer exp1(theShape1, TopAbs_VERTEX);
+
+ TopExp_Explorer exp2(theShape2, TopAbs_VERTEX);
TopoDS_Shape V1 = exp1.More() ? exp1.Current() : TopoDS_Shape();
TopoDS_Shape V2 = exp2.More() ? exp2.Current() : TopoDS_Shape();
exp1.Next();
BRepExtrema_DistShapeShape dst(theShape1, theShape2);
if (dst.IsDone()) {
- gp_Pnt P1, P2;
+ gp_Pnt P1;
+
+ gp_Pnt P2;
for (int i = 1; i <= dst.NbSolution(); i++) {
P1 = dst.PointOnShape1(i);
const TopoDS_Edge &anEdge =
TopoDS::Edge((*anEdgeIt)->impl<TopoDS_Shape>());
- double aFirst, aLast;
+ double aFirst;
+
+ double aLast;
TopLoc_Location aLoc;
Handle(Geom2d_Curve) aCurve =
BRep_Tool::CurveOnSurface(anEdge, myPlane, aLoc, aFirst, aLast);
const TopoDS_Edge &anEdge = TopoDS::Edge(theLine->impl<TopoDS_Shape>());
- double aFirst, aLast;
+ double aFirst;
+
+ double aLast;
TopLoc_Location aLoc;
Handle(Geom2d_Curve) aCurve =
BRep_Tool::CurveOnSurface(anEdge, myPlane, aLoc, aFirst, aLast);
int anAppropriateSolution = 1;
double aMinDist = Precision::Infinite();
- double aParSol, aPonTgCurve;
+ double aParSol;
+
+ double aPonTgCurve;
gp_Pnt2d aTgPnt;
for (int i = 1; i <= aNbSol && aNbSol > 1 && aCurve; ++i) {
theBuilder->Tangency1(i, aParSol, aPonTgCurve, aTgPnt);
int anAppropriateSolution = 1;
double aMinDist = Precision::Infinite();
- double aParSol, aPonTgCurve;
+ double aParSol;
+
+ double aPonTgCurve;
gp_Pnt2d aTgPnt;
for (int i = 1; i <= aNbSol && aNbSol > 1; ++i) {
bool isApplicable = false;
int anAppropriateSolution = 1;
double aMinDist = Precision::Infinite();
- double aParSol, aPonTgCurve;
+ double aParSol;
+
+ double aPonTgCurve;
gp_Pnt2d aTgPnt;
for (int i = 1; i <= aNbSol && aNbSol > 1; ++i) {
bool isApplicable = false;
aBuilder.MakeCompound(aComp);
std::list<std::shared_ptr<GeomAPI_Shape>>::const_iterator anIt = theShapes
- .begin(),
- aLast =
- theShapes.end();
+
+ .begin();
+
+ std::list<std::shared_ptr<GeomAPI_Shape>>::const_iterator aLast =
+
+ theShapes.end();
for (; anIt != aLast; anIt++) {
aBuilder.Add(aComp, (*anIt)->impl<TopoDS_Shape>());
}
// box of the face (vertices projected to the axis) plus 10%
Bnd_Box aFaceBnd;
BRepBndLib::Add(aFace, aFaceBnd);
- gp_Pnt aBoxMin(aFaceBnd.CornerMin()), aBoxMax(aFaceBnd.CornerMax());
+ gp_Pnt aBoxMin(aFaceBnd.CornerMin());
+
+ gp_Pnt aBoxMax(aFaceBnd.CornerMax());
bool isFirst = true;
- double aParamMin = 0, aParamMax = 0;
+ double aParamMin = 0;
+
+ double aParamMax = 0;
for (int aX = 0; aX < 2; aX++) {
for (int aY = 0; aY < 2; aY++) {
for (int aZ = 0; aZ < 2; aZ++) {
GeomPointPtr aStartPnt = anEllipse.project(theStart);
GeomPointPtr aEndPnt = anEllipse.project(theEnd);
- double aStartParam, aEndParam;
+ double aStartParam;
+
+ double aEndParam;
anEllipse.parameter(aStartPnt, Precision::Confusion(), aStartParam);
anEllipse.parameter(aEndPnt, Precision::Confusion(), aEndParam);
std::shared_ptr<GeomAPI_Face> GeomAlgoAPI_FaceBuilder::planarFace(
const std::shared_ptr<GeomAPI_Pln> thePlane, const double theX,
const double theY, const double theWidth, const double theHeight) {
- double aA, aB, aC, aD;
+ double aA;
+
+ double aB;
+
+ double aC;
+
+ double aD;
thePlane->coefficients(aA, aB, aC, aD);
gp_Pln aPlane(aA, aB, aC, aD);
if (BRep_Tool::Degenerated(anEdge))
continue;
- double aFirst, aLast;
+ double aFirst;
+
+ double aLast;
Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, aFirst, aLast);
aCurve = new Geom_TrimmedCurve(aCurve, aFirst, aLast);
}
// build calculated surface
- Standard_Integer UDegree, VDegree, NbUPoles, NbVPoles, NbUKnots, NbVKnots;
+ Standard_Integer UDegree;
+
+ Standard_Integer VDegree;
+
+ Standard_Integer NbUPoles;
+
+ Standard_Integer NbVPoles;
+
+ Standard_Integer NbUKnots;
+
+ Standard_Integer NbVKnots;
anAppSurf.SurfShape(UDegree, VDegree, NbUPoles, NbVPoles, NbUKnots, NbVKnots);
Handle(Geom_BSplineSurface) GBS = new Geom_BSplineSurface(
anAppSurf.SurfPoles(), anAppSurf.SurfWeights(), anAppSurf.SurfUKnots(),
}
if (aFirstShape.ShapeType() == TopAbs_EDGE) {
- GeomShapePtr aFirstWire, aSecondWire;
- ListOfShape aFirstEdge, aSecondEdge;
+ GeomShapePtr aFirstWire;
+
+ GeomShapePtr aSecondWire;
+ ListOfShape aFirstEdge;
+
+ ListOfShape aSecondEdge;
// Convert first edge to wire
aFirstEdge.push_back(theFirstShape);
} else if (Abs(dLength) < tol && lhs->shapeType() <= GeomAPI_Shape::FACE) {
// equal values possible on shapes such as two halves of a sphere and
// a membrane inside the sphere
- Bnd_Box box1, box2;
+ Bnd_Box box1;
+
+ Bnd_Box box2;
BRepBndLib::Add(lhs->impl<TopoDS_Shape>(), box1);
if (!box1.IsVoid()) {
BRepBndLib::Add(rhs->impl<TopoDS_Shape>(), box2);
if (dSquareExtent >= tol) {
exchange = Standard_True;
} else if (Abs(dSquareExtent) < tol) {
- Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax, value1,
- value2;
+ Standard_Real aXmin;
+
+ Standard_Real aYmin;
+
+ Standard_Real aZmin;
+
+ Standard_Real aXmax;
+
+ Standard_Real aYmax;
+
+ Standard_Real aZmax;
+
+ Standard_Real value1;
+
+ Standard_Real value2;
box1.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
value1 = (aXmin + aXmax) * 999.0 + (aYmin + aYmax) * 99.0 +
(aZmin + aZmax) * 0.9;
// check and fix pcurves, if necessary
TopExp_Explorer aExpE;
- Standard_Real aT, aTolE, aDMax;
+ Standard_Real aT;
+
+ Standard_Real aTolE;
+
+ Standard_Real aDMax;
ShapeFix_ShapeTolerance sat;
aExpE.Init(aNewFace, TopAbs_EDGE);
for (; aExpE.More(); aExpE.Next()) {
// Point
gp_Pnt p1(0, 0, 0);
// Point parameters on surface
- double u1, u2, v1, v2;
+ double u1;
+
+ double u2;
+
+ double v1;
+
+ double v2;
Handle(Geom_Surface) aSurf = BRep_Tool::Surface(aFace);
Handle(ShapeAnalysis_Surface) aSurfAna = new ShapeAnalysis_Surface(aSurf);
gp_Ax3 aPos = GetPosition(aFace);
}
// Normal direction
- gp_Vec Vec1, Vec2;
+ gp_Vec Vec1;
+
+ gp_Vec Vec2;
BRepAdaptor_Surface SF(aFace);
SF.D1(pUV.X(), pUV.Y(), p1, Vec1, Vec2);
if (Vec1.Magnitude() < Precision::Confusion()) {
// (only if average radius of curvature is not appropriate)
if (radius < Precision::Confusion()) {
Bnd_Box B;
- Standard_Real Xmin, Xmax, Ymin, Ymax, Zmin, Zmax;
+ Standard_Real Xmin;
+
+ Standard_Real Xmax;
+
+ Standard_Real Ymin;
+
+ Standard_Real Ymax;
+
+ Standard_Real Zmin;
+
+ Standard_Real Zmax;
BRepBndLib::Add(aFace, B);
B.Get(Xmin, Ymin, Zmin, Xmax, Ymax, Zmax);
radius = ((Xmax - Xmin) + (Ymax - Ymin) + (Zmax - Zmin)) / 3.0;
if (!getPath(aPathWire, thePathShape)) {
return;
}
- GeomShapePtr anOldPath(new GeomAPI_Shape), aNewPath(new GeomAPI_Shape);
+ GeomShapePtr anOldPath(new GeomAPI_Shape);
+
+ GeomShapePtr aNewPath(new GeomAPI_Shape);
anOldPath->setImpl(new TopoDS_Shape(aPathWire));
aPathWire.Move(getPathToBaseTranslation(aBaseShape, aPathWire));
aNewPath->setImpl(new TopoDS_Shape(aPathWire));
return;
}
- GeomShapePtr anOldPath(new GeomAPI_Shape), aNewPath(new GeomAPI_Shape);
+ GeomShapePtr anOldPath(new GeomAPI_Shape);
+
+ GeomShapePtr aNewPath(new GeomAPI_Shape);
anOldPath->setImpl(new TopoDS_Shape(aPathWire));
aPathWire.Move(
getPathToBaseTranslation(theBaseShape->impl<TopoDS_Shape>(), aPathWire));
return;
}
TopoDS_Edge aBiNormalEdge = TopoDS::Edge(aBiNormalShape);
- Standard_Real aFirst, aLast;
+ Standard_Real aFirst;
+
+ Standard_Real aLast;
Handle(Geom_Curve) aBiNormalCurve =
BRep_Tool::Curve(aBiNormalEdge, aFirst, aLast);
Handle(Geom_Line) aBiNormalLine = Handle(Geom_Line)::DownCast(aBiNormalCurve);
TopoDS_Shape aReallyBase = theBaseShapes.front()->impl<TopoDS_Shape>();
gp_Trsf aTrsf = getPathToBaseTranslation(aReallyBase, aPathWire);
- GeomShapePtr anOldPath(new GeomAPI_Shape), aNewPath(new GeomAPI_Shape);
+ GeomShapePtr anOldPath(new GeomAPI_Shape);
+
+ GeomShapePtr aNewPath(new GeomAPI_Shape);
anOldPath->setImpl(new TopoDS_Shape(aPathWire));
aPathWire.Move(aTrsf);
aNewPath->setImpl(new TopoDS_Shape(aPathWire));
TopoDS_Shape aResult = aPipeBuilder->Shape();
// Setting naming.
- GeomShapePtr aFromShape(new GeomAPI_Shape), aToShape(new GeomAPI_Shape);
+ GeomShapePtr aFromShape(new GeomAPI_Shape);
+
+ GeomShapePtr aToShape(new GeomAPI_Shape);
aFromShape->setImpl(new TopoDS_Shape(aPipeBuilder->FirstShape()));
aToShape->setImpl(new TopoDS_Shape(aPipeBuilder->LastShape()));
fixOrientation(aFromShape);
if (!BRep_Tool::IsClosed(thePath)) {
TopoDS_Wire aPathWire = TopoDS::Wire(thePath);
if (!aPathWire.IsNull()) {
- TopoDS_Vertex aV1, aV2;
+ TopoDS_Vertex aV1;
+
+ TopoDS_Vertex aV2;
TopExp::Vertices(aPathWire, aV1, aV2);
gp_Pnt aStart = BRep_Tool::Pnt(aV1);
}
const TopoDS_Edge &anEdge = TopoDS::Edge(theEdge->impl<TopoDS_Shape>());
- Standard_Real aUFirst, aULast;
+ Standard_Real aUFirst;
+
+ Standard_Real aULast;
Handle(Geom_Curve) anEdgeCurve = BRep_Tool::Curve(anEdge, aUFirst, aULast);
if (!anEdgeCurve.IsNull()) {
gp_Pnt aPnt(aProjPnt->x(), aProjPnt->y(), aProjPnt->z());
TopoDS_Edge anEdge = TopoDS::Edge(theEdge->impl<TopoDS_Shape>());
- double aFirstOnCurve, aLastOnCurve;
+ double aFirstOnCurve;
+
+ double aLastOnCurve;
Handle(Geom_Curve) aCurve =
BRep_Tool::Curve(anEdge, aFirstOnCurve, aLastOnCurve);
TopExp_Explorer anExplo(aFace, TopAbs_EDGE);
for (; anExplo.More(); anExplo.Next()) {
const TopoDS_Edge &anEdge = TopoDS::Edge(anExplo.Current());
- Standard_Real aFirst, aLast;
+ Standard_Real aFirst;
+
+ Standard_Real aLast;
Handle(Geom2d_Curve) aPCurve =
BRep_Tool::CurveOnSurface(anEdge, aFace, aFirst, aLast);
aBB.UpdateEdge(anEdge, aPCurve, anInputSurf, anInputLoc, 0.);
if (theIsNaturalRestrictions) {
BRepAdaptor_Surface aBAsurf(theFace);
- Standard_Real aUmin, aUmax, aVmin, aVmax;
+ Standard_Real aUmin;
+
+ Standard_Real aUmax;
+
+ Standard_Real aVmin;
+
+ Standard_Real aVmax;
aUmin = aBAsurf.FirstUParameter();
aUmax = aBAsurf.LastUParameter();
aVmin = aBAsurf.FirstVParameter();
Standard_Integer aSum = 0;
while (aSum < aDiff) // global loop
{
- Standard_Integer aNbFacesDone = 0, aNbFacesInTape = 0;
+ Standard_Integer aNbFacesDone = 0;
+
+ Standard_Integer aNbFacesInTape = 0;
TopoDS_Face aStartFace;
Standard_Integer aStartIndex = (theIsToAddFaces) ? aNbFaces - 1 : 0;
TopTools_IndexedDataMapOfShapeListOfShape aEFmap;
TopExp::MapShapesAndAncestors(res, TopAbs_EDGE, TopAbs_FACE, aEFmap);
- TopTools_MapOfShape aBiggestFaces, aSmallestFaces;
+ TopTools_MapOfShape aBiggestFaces;
+
+ TopTools_MapOfShape aSmallestFaces;
Standard_Boolean aUseTriangulation = Standard_True;
Standard_Boolean aSkipShared = Standard_False;
if (aNbFaces != theNumberOfPoints) {
gp_Pln(aToPnt->impl<gp_Pnt>(), aToDir->impl<gp_Dir>()));
IntAna_Quadric aBndFromQuadric(
gp_Pln(aFromPnt->impl<gp_Pnt>(), aFromDir->impl<gp_Dir>()));
- Standard_Real aMaxToDist = 0, aMaxFromDist = 0;
+ Standard_Real aMaxToDist = 0;
+
+ Standard_Real aMaxFromDist = 0;
for (const auto &aPoint : aPoints) {
gp_Lin aLine(aPoint, anExtVec);
IntAna_IntConicQuad aToIntAna(aLine, aBndToQuadric);
aBoundingToShape = buildPlanarFace(aBoundingToShape, aBndBox);
// Perform partition.
- ListOfShape anObjects, aTools;
+ ListOfShape anObjects;
+
+ ListOfShape aTools;
anObjects.push_back(aResult);
aTools.push_back(aBoundingFromShape);
aTools.push_back(aBoundingToShape);
BRepPrimAPI_MakePrism *thePrismBuilder) {
for (TopExp_Explorer anExp(theBase, theType); anExp.More(); anExp.Next()) {
const TopoDS_Shape &aShape = anExp.Current();
- GeomShapePtr aFromShape(new GeomAPI_Shape), aToShape(new GeomAPI_Shape);
+ GeomShapePtr aFromShape(new GeomAPI_Shape);
+
+ GeomShapePtr aToShape(new GeomAPI_Shape);
aFromShape->setImpl(new TopoDS_Shape(thePrismBuilder->FirstShape(aShape)));
aToShape->setImpl(new TopoDS_Shape(thePrismBuilder->LastShape(aShape)));
thePrismAlgo->fixOrientation(aFromShape);
const auto &aShape = theEdge->impl<TopoDS_Shape>();
TopoDS_Edge anEdge = TopoDS::Edge(aShape);
if (!anEdge.IsNull()) {
- double aStart, aEnd;
+ double aStart;
+
+ double aEnd;
Handle(Geom_Curve) anEdgeCurve = BRep_Tool::Curve(anEdge, aStart, aEnd);
if (!anEdgeCurve.IsNull() && !BRep_Tool::IsClosed(anEdge))
anEdgeCurve = new Geom_TrimmedCurve(anEdgeCurve, aStart, aEnd);
BRepPrimAPI_MakeRevol *theRevolBuilder) {
for (TopExp_Explorer anExp(theBase, theType); anExp.More(); anExp.Next()) {
const TopoDS_Shape &aShape = anExp.Current();
- GeomShapePtr aFromShape(new GeomAPI_Shape), aToShape(new GeomAPI_Shape);
+ GeomShapePtr aFromShape(new GeomAPI_Shape);
+
+ GeomShapePtr aToShape(new GeomAPI_Shape);
aFromShape->setImpl(new TopoDS_Shape(theRevolBuilder->FirstShape(aShape)));
aToShape->setImpl(new TopoDS_Shape(theRevolBuilder->LastShape(aShape)));
theRevolutionAlgo->fixOrientation(aFromShape);
Quantity_Color aCol;
if (theColorTool->GetColor(theLabel, XCAFDoc_ColorGen, aCol)) {
- double r = aCol.Red(), g = aCol.Green(), b = aCol.Blue();
+ double r = aCol.Red();
+
+ double g = aCol.Green();
+
+ double b = aCol.Blue();
std::vector<int> ColRGB = {int(r * 255), int(g * 255), int(b * 255)};
theResultBody->addShapeColor(aShapeName, ColRGB);
} else if (theColorTool->GetColor(theLabel, XCAFDoc_ColorSurf, aCol)) {
- double r = aCol.Red(), g = aCol.Green(), b = aCol.Blue();
+ double r = aCol.Red();
+
+ double g = aCol.Green();
+
+ double b = aCol.Blue();
std::vector<int> aColRGB = {int(r * 255), int(g * 255), int(b * 255)};
theResultBody->addShapeColor(aShapeName, aColRGB);
} else if (theColorTool->GetColor(theLabel, XCAFDoc_ColorCurv, aCol)) {
- double aR = aCol.Red(), aG = aCol.Green(), aB = aCol.Blue();
+ double aR = aCol.Red();
+
+ double aG = aCol.Green();
+
+ double aB = aCol.Blue();
std::vector<int> aColRGB = {int(aR * 255), int(aG * 255), int(aB * 255)};
theResultBody->addShapeColor(aShapeName, aColRGB);
}
if (theColorTool->GetColor(aXp2.Current(), XCAFDoc_ColorGen, aCol) ||
theColorTool->GetColor(aXp2.Current(), XCAFDoc_ColorSurf, aCol) ||
theColorTool->GetColor(aXp2.Current(), XCAFDoc_ColorCurv, aCol)) {
- double aR = aCol.Red(), aG = aCol.Green(), aB = aCol.Blue();
+ double aR = aCol.Red();
+
+ double aG = aCol.Green();
+
+ double aB = aCol.Blue();
TopoDS_Face aFace = TopoDS::Face(aXp2.Current());
std::vector<int> aColRGB = {int(aR * 255), int(aG * 255),
int(aB * 255)};
// as PRODUCT can be included in the main shape
// several times, we look here for all iclusions.
- Standard_Integer anISub, aNbSubs = theIndices.Extent();
+ Standard_Integer anISub;
+
+ Standard_Integer aNbSubs = theIndices.Extent();
for (anISub = 1; anISub <= aNbSubs; anISub++) {
TopoDS_Shape aSub = theIndices.FindKey(anISub);
// ASCII mode
aWriter.ASCIIMode() = theIsASCII;
if (theIsRelative) {
- Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax;
+ Standard_Real aXmin;
+
+ Standard_Real aYmin;
+
+ Standard_Real aZmin;
+
+ Standard_Real aXmax;
+
+ Standard_Real aYmax;
+
+ Standard_Real aZmax;
Bnd_Box aBndBox;
BRepBndLib::Add(theShape->impl<TopoDS_Shape>(), aBndBox);
aBndBox.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
case GeomAPI_Shape::COMPOUND: {
setShapeType(myShape->shapeType() == GeomAPI_Shape::COMPSOLID ? "CompSolid"
: "Compound");
- double aXmin, aYmin, aZmin, aXmax, aYmax, aZmax;
+ double aXmin;
+
+ double aYmin;
+
+ double aZmin;
+
+ double aXmax;
+
+ double aYmax;
+
+ double aZmax;
if (myShape->computeSize(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax)) {
theVals.addGroupName("Bounding box");
GeomPointPtr aMinPoint(new GeomAPI_Pnt(aXmin, aYmin, aZmin));
Extrema_ExtPC aParamSearch(thePoint, theCurve, theCurve.FirstParameter(),
theCurve.LastParameter());
if (aParamSearch.IsDone()) {
- Standard_Integer anIndMin = 0, aNbExt = aParamSearch.NbExt();
+ Standard_Integer anIndMin = 0;
+
+ Standard_Integer aNbExt = aParamSearch.NbExt();
Standard_Real aSqDistMin = RealLast();
for (Standard_Integer i = 1; i <= aNbExt; ++i) {
if (aParamSearch.SquareDistance(i) < aSqDistMin) {
Extrema_ExtPS aParamSearch(thePoint, theSurf, Precision::PConfusion(),
Precision::PConfusion());
if (aParamSearch.IsDone()) {
- Standard_Integer anIndMin = 0, aNbExt = aParamSearch.NbExt();
+ Standard_Integer anIndMin = 0;
+
+ Standard_Integer aNbExt = aParamSearch.NbExt();
Standard_Real aSqDistMin = RealLast();
for (Standard_Integer i = 1; i <= aNbExt; ++i) {
if (aParamSearch.SquareDistance(i) < aSqDistMin) {
if (!aTria.IsNull())
aTol = Max(aTol, aTria->Deflection());
- Standard_Real aU, aV;
+ Standard_Real aU;
+
+ Standard_Real aV;
paramsOnSurf(aSurf, thePointOnFace, 2 * aTol, aU, aV);
Standard_Real aValue = -1.0;
Standard_Real aP =
paramOnCurve(aCurve, thePonE, BRep_Tool::Tolerance(theEdge));
- Standard_Real aU, aV;
+ Standard_Real aU;
+
+ Standard_Real aV;
paramsOnSurf(aSurf, thePonF, BRep_Tool::Tolerance(theFace), aU, aV);
Standard_Real aValue = -1.0;
BRepAdaptor_Surface aSurf1(theFace1);
BRepAdaptor_Surface aSurf2(theFace2);
- Standard_Real aU1, aV1;
+ Standard_Real aU1;
+
+ Standard_Real aV1;
paramsOnSurf(aSurf1, thePoint1, BRep_Tool::Tolerance(theFace1), aU1, aV1);
- Standard_Real aU2, aV2;
+ Standard_Real aU2;
+
+ Standard_Real aV2;
paramsOnSurf(aSurf2, thePoint2, BRep_Tool::Tolerance(theFace2), aU2, aV2);
Standard_Real aValue = -1.0;
}
TopoDS_Shape anInShape = aResult->impl<TopoDS_Shape>();
- NCollection_List<TopoDS_Shape> anUngroupedShapes, aStillUngroupedShapes;
+ NCollection_List<TopoDS_Shape> anUngroupedShapes;
+
+ NCollection_List<TopoDS_Shape> aStillUngroupedShapes;
addSimpleShapeToList(anInShape, anUngroupedShapes);
// Iterate over all shapes and find shapes with shared vertices.
const gp_Pln &aFacePln = isPlanar.Plan();
Handle(Geom_Plane) aFacePlane = new Geom_Plane(aFacePln);
IntAna_Quadric aQuadric(aFacePln);
- Standard_Real UMin, UMax, VMin, VMax;
+ Standard_Real UMin;
+
+ Standard_Real UMax;
+
+ Standard_Real VMin;
+
+ Standard_Real VMax;
UMin = UMax = VMin = VMax = 0;
for (const auto &thePoint : thePoints) {
const auto &aPnt = thePoint->impl<gp_Pnt>();
gp_Lin aLin(aPnt, aFacePln.Axis().Direction());
IntAna_IntConicQuad anIntAna(aLin, aQuadric);
const gp_Pnt &aPntOnFace = anIntAna.Point(1);
- Standard_Real aPntU(0), aPntV(0);
+ Standard_Real aPntU(0);
+
+ Standard_Real aPntV(0);
GeomLib_Tool::Parameters(aFacePlane, aPntOnFace, Precision::Confusion(),
aPntU, aPntV);
if (aPntU < UMin)
if (theShape) {
const auto &aShape = theShape->impl<TopoDS_Shape>();
- TopoDS_Vertex aV1, aV2;
+ TopoDS_Vertex aV1;
+
+ TopoDS_Vertex aV2;
ShapeAnalysis::FindBounds(aShape, aV1, aV2);
- std::shared_ptr<GeomAPI_Vertex> aGeomV1(new GeomAPI_Vertex()),
- aGeomV2(new GeomAPI_Vertex());
+ std::shared_ptr<GeomAPI_Vertex> aGeomV1(new GeomAPI_Vertex());
+
+ std::shared_ptr<GeomAPI_Vertex> aGeomV2(new GeomAPI_Vertex());
aGeomV1->setImpl(new TopoDS_Vertex(aV1));
aGeomV2->setImpl(new TopoDS_Vertex(aV2));
theV1 = aGeomV1;
}
// Check intersections.
- TopoDS_Vertex aV1, aV2;
+ TopoDS_Vertex aV1;
+
+ TopoDS_Vertex aV2;
ShapeAnalysis::FindBounds(anEdge, aV1, aV2);
gp_Pnt aPnt1 = BRep_Tool::Pnt(aV1);
gp_Pnt aPnt2 = BRep_Tool::Pnt(aV2);
GeomPointPtr aLastPnt = theEdge->lastPoint();
double aLastPntTol = theEdge->lastPointTolerance();
- double aFirst, aLast;
+ double aFirst;
+
+ double aLast;
theEdge->getRange(aFirst, aLast);
bool isFirst = aPoint->distance(aFirstPnt) <= aFirstPntTol;
const std::shared_ptr<GeomAPI_Edge> theEdge1,
const std::shared_ptr<GeomAPI_Edge> theEdge2,
const std::shared_ptr<GeomAPI_Vertex> theTgPoint) {
- double aParE1 = 0, aParE2 = 0;
+ double aParE1 = 0;
+
+ double aParE2 = 0;
if (!boundaryOfEdge(theEdge1, theTgPoint, aParE1) ||
!boundaryOfEdge(theEdge2, theTgPoint, aParE2))
return false;
}
TopoDS_Edge anEdge = TopoDS::Edge(theEdge->impl<TopoDS_Shape>());
- double aFirstOnCurve, aLastOnCurve;
+ double aFirstOnCurve;
+
+ double aLastOnCurve;
Handle(Geom_Curve) aCurve =
BRep_Tool::Curve(anEdge, aFirstOnCurve, aLastOnCurve);
// Rebuild closed edge to place vertex to one of split points.
// This will prevent edge to be split on same vertex.
if (BRep_Tool::IsClosed(aBaseEdge)) {
- Standard_Real aFirst, aLast;
+ Standard_Real aFirst;
+
+ Standard_Real aLast;
Handle(Geom_Curve) aCurve = BRep_Tool::Curve(aBaseEdge, aFirst, aLast);
auto aPIt = thePointsInfo.begin();
// Rebuild closed edge to place vertex to one of split points.
// This will prevent edge to be split on seam vertex.
if (BRep_Tool::IsClosed(aBaseEdge)) {
- Standard_Real aFirst, aLast;
+ Standard_Real aFirst;
+
+ Standard_Real aLast;
Handle(Geom_Curve) aCurve = BRep_Tool::Curve(aBaseEdge, aFirst, aLast);
auto aPIt = thePoints.begin();
aPntIt++;
std::shared_ptr<GeomAPI_Pnt> aLastPoint = *aPntIt;
- auto anIt = theShapes.begin(), aLast = theShapes.end();
+ auto anIt = theShapes.begin();
+
+ auto aLast = theShapes.end();
for (; anIt != aLast; anIt++) {
GeomShapePtr aShape = *anIt;
std::shared_ptr<GeomAPI_Edge> anEdge(new GeomAPI_Edge(aShape));
BRepTools_WireExplorer aWExp(theWire);
for (; aWExp.More(); aWExp.Next()) {
TopoDS_Edge anEdge = aWExp.Current();
- double aFirst, aLast;
+ double aFirst;
+
+ double aLast;
Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, aFirst, aLast);
if (aCurve == aPrevCurve &&
Abs(aFirst - aPrevLastParam) > Precision::Confusion()) {
// if parametric gap occurs, create new edge based on the copied curve
aCurve = Handle(Geom_Curve)::DownCast(aCurve->Copy());
- TopoDS_Vertex aV1, aV2;
+ TopoDS_Vertex aV1;
+
+ TopoDS_Vertex aV2;
TopExp::Vertices(anEdge, aV1, aV2);
anEdge = TopoDS::Edge(anEdge.EmptyCopied());
aBuilder.UpdateEdge(anEdge, aCurve, BRep_Tool::Tolerance(anEdge));
// curvilinear abscissa.
static const int THE_MAX_DEGREE = 14;
static const int THE_MAX_INTERVALS = 32;
- double aFirst, aLast;
+ double aFirst;
+
+ double aLast;
Handle(Geom_Curve) aCurve = BRep_Tool::Curve(aNewEdge, aFirst, aLast);
#if OCC_VERSION_LARGE < 0x07070000
Handle(GeomAdaptor_HCurve) aHCurve = new GeomAdaptor_HCurve(aCurve);
}
// Objects bounds
- Standard_Real lowBnd, upperBnd;
+ Standard_Real lowBnd;
+
+ Standard_Real upperBnd;
getMinMaxPointsOnLine(aBndObjs, aDir, lowBnd, upperBnd);
// Base bounds
- Standard_Real lowBase, upperBase;
+ Standard_Real lowBase;
+
+ Standard_Real upperBase;
getMinMaxPointsOnLine(aBndBases, aDir, lowBase, upperBase);
// ----------.-----.---------.--------------.-----------> theDir
}
// Objects bounds
- Standard_Real lowBnd, upperBnd;
+ Standard_Real lowBnd;
+
+ Standard_Real upperBnd;
getMinMaxPointsOnLine(aBndObjs, aDir, lowBnd, upperBnd);
// Base bounds
- Standard_Real lowBase, upperBase;
+ Standard_Real lowBase;
+
+ Standard_Real upperBase;
getMinMaxPointsOnLine(aBndBases, aDir, lowBase, upperBase);
// ----------.-----.---------.--------------.-----------> theDir
if (anEdge.ShapeType() != TopAbs_EDGE)
continue;
- double aFirst, aLast;
+ double aFirst;
+
+ double aLast;
Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, aFirst, aLast);
if (aCurve->DynamicType() == STANDARD_TYPE(Geom_TrimmedCurve))
aCurve = Handle(Geom_TrimmedCurve)::DownCast(aCurve)->BasisCurve();
BRepTools_WireExplorer anExp(theWire, theFace);
for (; anExp.More(); anExp.Next()) {
const TopoDS_Edge &aShapeEdge = anExp.Current();
- double aF, aL;
+ double aF;
+
+ double aL;
Handle(Geom_Curve) aShapeCurve = BRep_Tool::Curve(aShapeEdge, aF, aL);
if (aShapeCurve->DynamicType() == STANDARD_TYPE(Geom_TrimmedCurve))
aShapeCurve =
continue;
// the edge is found, search vertex
- TopoDS_Vertex aV1, aV2;
+ TopoDS_Vertex aV1;
+
+ TopoDS_Vertex aV2;
TopExp::Vertices(aShapeEdge, aV1, aV2);
return fabs(aF - aFirst) <= fabs(aL - aFirst) ? aV1 : aV2;
}
NCollection_List<int> aNewList;
TopExp_Explorer anEdgesExp(aShape, TopAbs_EDGE);
for (; anEdgesExp.More(); anEdgesExp.Next()) {
- double aFirst, aLast;
+ double aFirst;
+
+ double aLast;
Handle(Geom_Curve) aCurve =
BRep_Tool::Curve(TopoDS::Edge(anEdgesExp.Current()), aFirst, aLast);
if (aCurve->DynamicType() == STANDARD_TYPE(Geom_TrimmedCurve))
if (anEdge.ShapeType() != TopAbs_EDGE)
continue;
- double aFirst, aLast;
+ double aFirst;
+
+ double aLast;
Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, aFirst, aLast);
if (aCurve->DynamicType() == STANDARD_TYPE(Geom_TrimmedCurve))
aCurve = Handle(Geom_TrimmedCurve)::DownCast(aCurve)->BasisCurve();
continue;
if (!aStartFound) {
const TopoDS_Edge &anEdge = anExp.Current();
- TopoDS_Vertex aV1, aV2;
+ TopoDS_Vertex aV1;
+
+ TopoDS_Vertex aV2;
TopExp::Vertices(anEdge, aV1, aV2, Standard_True);
if (aV1.IsSame(aStartVertex) == Standard_True)
aStartFound = true;
theTolerance);
} else if (aDistance.SupportTypeShape2(sol) == BRepExtrema_IsInFace) {
TopoDS_Face aFace = TopoDS::Face(aDistance.SupportOnShape2(sol));
- double aParU, aParV;
+ double aParU;
+
+ double aParV;
aDistance.ParOnFaceS2(sol, aParU, aParV);
aResult |= classifyVicinityOnFace(theClassifier, aFace, aParU, aParV,
const TopoDS_Edge &aLHSEdge = TopoDS::Edge(theLHS->impl<TopoDS_Shape>());
const TopoDS_Edge &aRHSEdge = TopoDS::Edge(theRHS->impl<TopoDS_Shape>());
- double aLF, aLE, aRF, aRE;
+ double aLF;
+
+ double aLE;
+
+ double aRF;
+
+ double aRE;
Handle(Geom_Curve) aLHSCurve = BRep_Tool::Curve(aLHSEdge, aLF, aLE);
Handle(Geom_Curve) aRHSCurve = BRep_Tool::Curve(aRHSEdge, aRF, aRE);
Bnd_Box2d aLHSBox = boundingBoxUV(aLHSFace);
Bnd_Box2d aRHSBox = boundingBoxUV(aRHSFace);
- double aLHSBB[4], aRHSBB[4];
+ double aLHSBB[4];
+
+ double aRHSBB[4];
aLHSBox.Get(aLHSBB[0], aLHSBB[1], aLHSBB[2], aLHSBB[3]);
aRHSBox.Get(aRHSBB[0], aRHSBB[1], aRHSBB[2], aRHSBB[3]);
for (int anIndex = 0; anIndex < 4; ++anIndex) {
if (anEdge.IsNull())
return true;
- double aFirst, aLast;
+ double aFirst;
+
+ double aLast;
Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, aFirst, aLast);
bool isAdded = true;
if (anEdge1.IsNull() || anEdge2.IsNull())
return false;
- double aFirst1, aLast1;
+ double aFirst1;
+
+ double aLast1;
Handle(Geom_Curve) aCurve1 = BRep_Tool::Curve(anEdge1, aFirst1, aLast1);
- double aFirst2, aLast2;
+ double aFirst2;
+
+ double aLast2;
Handle(Geom_Curve) aCurve2 = BRep_Tool::Curve(anEdge2, aFirst2, aLast2);
return aCurve1 == aCurve2 &&
fabs(aFirst1 - aFirst2) < Precision::Confusion() &&
if (isSplitWire) {
bool isToReshape = false;
BRepTools_ReShape aReshape;
- TopoDS_Vertex aVF, aVL;
+ TopoDS_Vertex aVF;
+
+ TopoDS_Vertex aVL;
TopExp::Vertices(aNewCurrent, aVF, aVL);
gp_Pnt aPF = BRep_Tool::Pnt(aVF);
double aTolF = BRep_Tool::Tolerance(aVF);
for (TopTools_ListOfShape::Iterator aBaseIt(aListOfEdges); aBaseIt.More();
aBaseIt.Next()) {
TopoDS_Edge aBaseCurrent = TopoDS::Edge(aBaseIt.Value());
- Standard_Real aFirst, aLast;
+ Standard_Real aFirst;
+
+ Standard_Real aLast;
Handle(Geom_Curve) aBaseCurve =
BRep_Tool::Curve(aBaseCurrent, aFirst, aLast);
const Standard_Real U,
const Standard_Real V, gp_Vec &aN) {
gp_Pnt aPnt;
- gp_Vec aD1U, aD1V;
+ gp_Vec aD1U;
+
+ gp_Vec aD1V;
Handle(Geom_Surface) aSurface;
aSurface = BRep_Tool::Surface(aF);
Standard_Integer GEOMAlgo_AlgoTools::BuildPCurveForEdgeOnFace(
const TopoDS_Edge &aEold, const TopoDS_Edge &aEnew, const TopoDS_Face &aF,
const Handle(IntTools_Context) & aCtx) {
- Standard_Boolean bIsClosed, bUClosed, bHasOld;
- Standard_Integer iRet, aNbPoints;
- Standard_Real aTS, aTS1, aTS2, aT, aT1, aT2, aScPr, aTol;
- Standard_Real aU, aV, aUS1, aVS1, aUS2, aVS2;
+ Standard_Boolean bIsClosed;
+
+ Standard_Boolean bUClosed;
+
+ Standard_Boolean bHasOld;
+ Standard_Integer iRet;
+
+ Standard_Integer aNbPoints;
+ Standard_Real aTS;
+
+ Standard_Real aTS1;
+
+ Standard_Real aTS2;
+
+ Standard_Real aT;
+
+ Standard_Real aT1;
+
+ Standard_Real aT2;
+
+ Standard_Real aScPr;
+
+ Standard_Real aTol;
+ Standard_Real aU;
+
+ Standard_Real aV;
+
+ Standard_Real aUS1;
+
+ Standard_Real aVS1;
+
+ Standard_Real aUS2;
+
+ Standard_Real aVS2;
gp_Pnt aP;
- gp_Pnt2d aP2DS1, aP2DS2, aP2D;
- gp_Vec2d aV2DS1, aV2DS2;
+ gp_Pnt2d aP2DS1;
+
+ gp_Pnt2d aP2DS2;
+
+ gp_Pnt2d aP2D;
+ gp_Vec2d aV2DS1;
+
+ gp_Vec2d aV2DS2;
Handle(Geom2d_Curve) aC2D, aC2DS1, aC2DS2;
Handle(Geom_Surface) aS;
TopoDS_Edge aES;
//
// 3. Build the second 2D curve
Standard_Boolean bRevOrder;
- gp_Vec2d aV2DT, aV2D;
+ gp_Vec2d aV2DT;
+
+ gp_Vec2d aV2D;
Handle(Geom2d_Curve) aC2Dnew;
Handle(Geom2d_TrimmedCurve) aC2DTnew;
BRep_Builder aBB;
const TopoDS_Face &aF,
const Standard_Real aUMin,
const Standard_Real aUMax) {
- Standard_Real aT1, aT2, aTx, aUx, aTol;
+ Standard_Real aT1;
+
+ Standard_Real aT2;
+
+ Standard_Real aTx;
+
+ Standard_Real aUx;
+
+ Standard_Real aTol;
gp_Pnt2d aP2D;
Handle(Geom_Surface) aS;
Handle(Geom2d_Curve) aC2D;
const TopoDS_Edge &aEF1, const TopoDS_Edge &aEF2,
const Handle(IntTools_Context) & aContext) {
Standard_Boolean aFlag;
- Standard_Real aT1, aT2, aScPr, a, b;
- gp_Vec aV1, aV2;
+ Standard_Real aT1;
+
+ Standard_Real aT2;
+
+ Standard_Real aScPr;
+
+ Standard_Real a;
+
+ Standard_Real b;
+ gp_Vec aV1;
+
+ gp_Vec aV2;
gp_Pnt aP;
Handle(Geom_Curve) aC1 = BRep_Tool::Curve(aEF1, a, b);
if (BRep_Tool::Degenerated(aE2)) { // jfa
return Standard_True;
} else {
- Standard_Real f, l;
+ Standard_Real f;
+
+ Standard_Real l;
Handle(Geom_Curve) aC3D = BRep_Tool::Curve(aE2, f, l);
if (aC3D.IsNull()) {
return Standard_True;
// purpose :
//=======================================================================
void GEOMAlgo_AlgoTools::PointOnEdge(const TopoDS_Edge &aE, gp_Pnt &aP3D) {
- Standard_Real aTx, aT1, aT2;
+ Standard_Real aTx;
+
+ Standard_Real aT1;
+
+ Standard_Real aT2;
//
BRep_Tool::Curve(aE, aT1, aT2);
aTx = IntTools_Tools::IntermediatePoint(aT1, aT2);
//=======================================================================
void GEOMAlgo_AlgoTools::PointOnEdge(const TopoDS_Edge &aE,
const Standard_Real aT, gp_Pnt &aP3D) {
- Standard_Real aT1, aT2;
+ Standard_Real aT1;
+
+ Standard_Real aT2;
Handle(Geom_Curve) aC3D;
//
aC3D = BRep_Tool::Curve(aE, aT1, aT2);
// purpose :
//=======================================================================
void GEOMAlgo_AlgoTools::PointOnFace(const TopoDS_Face &aF, gp_Pnt &aP3D) {
- Standard_Real aU, aV, aUMin, aUMax, aVMin, aVMax;
+ Standard_Real aU;
+
+ Standard_Real aV;
+
+ Standard_Real aUMin;
+
+ Standard_Real aUMax;
+
+ Standard_Real aVMin;
+
+ Standard_Real aVMax;
//
BRepTools::UVBounds(aF, aUMin, aUMax, aVMin, aVMax);
//
const Standard_Real aTol, TopTools_ListOfShape &aLESD,
const Handle(IntTools_Context) & aCtx) {
Standard_Boolean bIsDone;
- Standard_Real aTol2, aD2;
- gp_Pnt aP1, aP2;
+ Standard_Real aTol2;
+
+ Standard_Real aD2;
+ gp_Pnt aP1;
+
+ gp_Pnt aP2;
TopTools_ListIteratorOfListOfShape aIt;
//
aTol2 = aTol * aTol;
const TopTools_ListOfShape &aLE, const Standard_Real aTol,
TopTools_IndexedDataMapOfShapeListOfShape &aMEE,
const Handle(IntTools_Context) & aCtx) {
- Standard_Integer aNbE, aNbEProcessed, aNbESD, iErr;
+ Standard_Integer aNbE;
+
+ Standard_Integer aNbEProcessed;
+
+ Standard_Integer aNbESD;
+
+ Standard_Integer iErr;
TopTools_ListOfShape aLESD;
- TopTools_ListIteratorOfListOfShape aIt, aIt1;
+ TopTools_ListIteratorOfListOfShape aIt;
+
+ TopTools_ListIteratorOfListOfShape aIt1;
TopTools_IndexedMapOfShape aMProcessed;
TopAbs_ShapeEnum aType;
//
Standard_Integer GEOMAlgo_AlgoTools::RefineSDShapes(
GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape &aMPKLE,
const Standard_Real aTol, const Handle(IntTools_Context) & aCtx) {
- Standard_Integer i, aNbE, iErr, j, aNbEE, aNbToAdd;
- TopTools_IndexedDataMapOfShapeListOfShape aMEE, aMSDE, aMEToAdd;
+ Standard_Integer i;
+
+ Standard_Integer aNbE;
+
+ Standard_Integer iErr;
+
+ Standard_Integer j;
+
+ Standard_Integer aNbEE;
+
+ Standard_Integer aNbToAdd;
+ TopTools_IndexedDataMapOfShapeListOfShape aMEE;
+
+ TopTools_IndexedDataMapOfShapeListOfShape aMSDE;
+
+ TopTools_IndexedDataMapOfShapeListOfShape aMEToAdd;
//
iErr = 1;
//
Bnd_Box B;
BRepBndLib::Add(theShape, B);
- Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax;
+ Standard_Real aXmin;
+
+ Standard_Real aYmin;
+
+ Standard_Real aZmin;
+
+ Standard_Real aXmax;
+
+ Standard_Real aYmax;
+
+ Standard_Real aZmax;
B.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
- Standard_Real dx = aXmax - aXmin, dy = aYmax - aYmin, dz = aZmax - aZmin;
+ Standard_Real dx = aXmax - aXmin;
+
+ Standard_Real dy = aYmax - aYmin;
+
+ Standard_Real dz = aZmax - aZmin;
Standard_Real aDeflection = Max(Max(dx, dy), dz) * aDeviationCoefficient * 4;
Standard_Real aHLRAngle = 0.349066;
//=======================================================================
Standard_Integer GEOMAlgo_AlgoTools::PntInFace(const TopoDS_Face &aF,
gp_Pnt &theP, gp_Pnt2d &theP2D) {
- Standard_Boolean bIsDone, bHasFirstPoint, bHasSecondPoint;
- Standard_Integer iErr, aIx, aNbDomains, i;
- Standard_Real aUMin, aUMax, aVMin, aVMax;
- Standard_Real aVx, aUx, aV1, aV2, aU1, aU2, aEpsT;
- Standard_Real aTotArcIntr, aTolTangfIntr, aTolHatch2D, aTolHatch3D;
+ Standard_Boolean bIsDone;
+
+ Standard_Boolean bHasFirstPoint;
+
+ Standard_Boolean bHasSecondPoint;
+ Standard_Integer iErr;
+
+ Standard_Integer aIx;
+
+ Standard_Integer aNbDomains;
+
+ Standard_Integer i;
+ Standard_Real aUMin;
+
+ Standard_Real aUMax;
+
+ Standard_Real aVMin;
+
+ Standard_Real aVMax;
+ Standard_Real aVx;
+
+ Standard_Real aUx;
+
+ Standard_Real aV1;
+
+ Standard_Real aV2;
+
+ Standard_Real aU1;
+
+ Standard_Real aU2;
+
+ Standard_Real aEpsT;
+ Standard_Real aTotArcIntr;
+
+ Standard_Real aTolTangfIntr;
+
+ Standard_Real aTolHatch2D;
+
+ Standard_Real aTolHatch3D;
gp_Dir2d aD2D(0., 1.);
gp_Pnt2d aP2D;
gp_Pnt aPx;
TopTools_IndexedDataMapOfShapeListOfShape aEFmap;
TopExp::MapShapesAndAncestors(res, TopAbs_EDGE, TopAbs_FACE, aEFmap);
- TopTools_MapOfShape aBiggestFaces, aSmallestFaces;
+ TopTools_MapOfShape aBiggestFaces;
+
+ TopTools_MapOfShape aSmallestFaces;
Standard_Boolean aUseTriangulation = Standard_True;
Standard_Boolean aSkipShared = Standard_False;
if (aNbFaces != theNbPnts) {
TopExp_Explorer anExplo(aFace, TopAbs_EDGE);
for (; anExplo.More(); anExplo.Next()) {
const TopoDS_Edge &anEdge = TopoDS::Edge(anExplo.Current());
- Standard_Real aFirst, aLast;
+ Standard_Real aFirst;
+
+ Standard_Real aLast;
Handle(Geom2d_Curve) aPCurve =
BRep_Tool::CurveOnSurface(anEdge, aFace, aFirst, aLast);
aBB.UpdateEdge(anEdge, aPCurve, anInputSurf, anInputLoc, 0.);
if (theIsNaturalRestrictions) {
BRepAdaptor_Surface aBAsurf(theFace);
- Standard_Real aUmin, aUmax, aVmin, aVmax;
+ Standard_Real aUmin;
+
+ Standard_Real aUmax;
+
+ Standard_Real aVmin;
+
+ Standard_Real aVmax;
aUmin = aBAsurf.FirstUParameter();
aUmax = aBAsurf.LastUParameter();
aVmin = aBAsurf.FirstVParameter();
Standard_Integer aSum = 0;
while (aSum < aDiff) // global loop
{
- Standard_Integer aNbFacesDone = 0, aNbFacesInTape = 0;
+ Standard_Integer aNbFacesDone = 0;
+
+ Standard_Integer aNbFacesInTape = 0;
TopoDS_Face aStartFace;
Standard_Integer aStartIndex = (theIsToAddFaces) ? aNbFaces - 1 : 0;
void GEOMAlgo_AlgoTools::FindChains(
const GEOMAlgo_IndexedDataMapOfShapeIndexedMapOfShape &aMCV,
GEOMAlgo_IndexedDataMapOfShapeIndexedMapOfShape &aMapChains) {
- Standard_Integer i, j, aNbCV, aNbV;
- TopTools_IndexedMapOfShape aProcessed, aChain;
+ Standard_Integer i;
+
+ Standard_Integer j;
+
+ Standard_Integer aNbCV;
+
+ Standard_Integer aNbV;
+ TopTools_IndexedMapOfShape aProcessed;
+
+ TopTools_IndexedMapOfShape aChain;
//
aNbCV = aMCV.Extent();
for (i = 1; i <= aNbCV; ++i) {
const GEOMAlgo_IndexedDataMapOfShapeIndexedMapOfShape &aMCV,
TopTools_IndexedMapOfShape &aProcessed,
TopTools_IndexedMapOfShape &aChain) {
- Standard_Integer j, aNbV;
+ Standard_Integer j;
+
+ Standard_Integer aNbV;
//
if (aProcessed.Contains(aF)) {
return;
//=======================================================================
Standard_Boolean
GEOMAlgo_BndSphere::IsOut(const GEOMAlgo_BndSphere &theOther) const {
- Standard_Real aD2, aT2;
+ Standard_Real aD2;
+
+ Standard_Real aT2;
//
aD2 = myCenter.SquareDistance(theOther.myCenter);
aT2 = myRadius + myGap + theOther.myRadius + theOther.myGap;
//=======================================================================
inline void GEOMAlgo_BndSphere::Add(const GEOMAlgo_BndSphere& theOther)
{
- Standard_Real aTmax, aR, aT, aTOther;
- gp_Pnt aPc;
- //
- aPc.SetXYZ(0.5*(myCenter.XYZ()+theOther.myCenter.XYZ()));
- //
- aR=aPc.Distance(myCenter);
- //
- aT=myRadius+myGap;
- aTOther=theOther.myRadius+theOther.myGap;
- aTmax=(aT>aTOther) ? aT: aTOther;
- //
- aR=aR+aTmax;
- //
- myCenter=aPc;
- myRadius=aR;
+ Standard_Real aTmax;
+
+ Standard_Real aR;
+
+ Standard_Real aT;
+
+ Standard_Real aTOther;
+ gp_Pnt aPc;
+ //
+ aPc.SetXYZ(0.5 * (myCenter.XYZ() + theOther.myCenter.XYZ()));
+ //
+ aR = aPc.Distance(myCenter);
+ //
+ aT = myRadius + myGap;
+ aTOther = theOther.myRadius + theOther.myGap;
+ aTmax = (aT > aTOther) ? aT : aTOther;
+ //
+ aR = aR + aTmax;
+ //
+ myCenter = aPc;
+ myRadius = aR;
}
//=======================================================================
//function : SquareExtent
// purpose :
//=======================================================================
void GEOMAlgo_GlueDetector::DetectVertices() {
- Standard_Integer j, i, aNbV, aNbVSD;
+ Standard_Integer j;
+
+ Standard_Integer i;
+
+ Standard_Integer aNbV;
+
+ Standard_Integer aNbVSD;
Standard_Real aTolV;
gp_Pnt aPV;
TColStd_ListIteratorOfListOfInteger aIt;
continue;
}
//
- Standard_Integer aNbIP, aIP, aNbIP1, aIP1;
+ Standard_Integer aNbIP;
+
+ Standard_Integer aIP;
+
+ Standard_Integer aNbIP1;
+
+ Standard_Integer aIP1;
TopTools_ListOfShape aLVSD;
- TColStd_MapOfInteger aMIP, aMIP1, aMIPC;
+ TColStd_MapOfInteger aMIP;
+
+ TColStd_MapOfInteger aMIP1;
+
+ TColStd_MapOfInteger aMIPC;
TColStd_MapIteratorOfMapOfInteger aIt1;
//
aMIP.Add(i);
//=======================================================================
void GEOMAlgo_GlueDetector::DetectShapes(const TopAbs_ShapeEnum aType) {
Standard_Boolean bDegenerated;
- Standard_Integer i, aNbF, aNbSDF, iErr;
+ Standard_Integer i;
+
+ Standard_Integer aNbF;
+
+ Standard_Integer aNbSDF;
+
+ Standard_Integer iErr;
TopTools_IndexedMapOfShape aMF;
TopTools_ListIteratorOfListOfShape aItLS;
GEOMAlgo_PassKeyShape aPKF;
//=======================================================================
void GEOMAlgo_GlueDetector::FacePassKey(const TopoDS_Face &aF,
GEOMAlgo_PassKeyShape &aPK) {
- Standard_Integer i, aNbE;
+ Standard_Integer i;
+
+ Standard_Integer aNbE;
TopoDS_Shape aER;
TopTools_ListOfShape aLE;
TopTools_IndexedMapOfShape aME;
TopTools_ListOfShape aLV;
TopTools_MapOfShape aMFence;
TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItIm;
- TopTools_IndexedDataMapOfShapeListOfShape aMVE, aMEV;
+ TopTools_IndexedDataMapOfShapeListOfShape aMVE;
+
+ TopTools_IndexedDataMapOfShapeListOfShape aMEV;
//
// 1. aMVE, aMEV
TopExp::MapShapesAndAncestors(myArgument, TopAbs_VERTEX, TopAbs_EDGE, aMVE);
const TopTools_ListOfShape &aLVSD,
const TopTools_IndexedDataMapOfShapeListOfShape &aMVE,
const TopTools_IndexedDataMapOfShapeListOfShape &aMEV) {
- Standard_Integer aNbVSD, iRet;
- TopExp_Explorer aExp, aExpA;
- TopTools_MapOfShape aMFence, aMVSD;
+ Standard_Integer aNbVSD;
+
+ Standard_Integer iRet;
+ TopExp_Explorer aExp;
+
+ TopExp_Explorer aExpA;
+ TopTools_MapOfShape aMFence;
+
+ TopTools_MapOfShape aMVSD;
TopTools_ListOfShape aLV;
TopTools_ListIteratorOfListOfShape aItLS;
//
const TopTools_IndexedDataMapOfShapeListOfShape &aMVE,
const TopTools_IndexedDataMapOfShapeListOfShape &aMEV,
TopTools_IndexedDataMapOfShapeListOfShape &aMEVZ) {
- TopTools_ListOfShape *pLE, *pLV, *pLVZ;
- Standard_Integer iRet, aNbVX;
- TopTools_ListIteratorOfListOfShape aItLE, aItLV;
+ TopTools_ListOfShape *pLE;
+
+ TopTools_ListOfShape *pLV;
+
+ TopTools_ListOfShape *pLVZ;
+ Standard_Integer iRet;
+
+ Standard_Integer aNbVX;
+ TopTools_ListIteratorOfListOfShape aItLE;
+
+ TopTools_ListIteratorOfListOfShape aItLV;
TopTools_MapOfShape aMFence;
TopTools_ListOfShape aLVX;
//
// purpose :
//=======================================================================
void GEOMAlgo_Gluer2::CheckData() {
- Standard_Integer aNbSG, i;
- TopAbs_ShapeEnum aType, aTypeX;
+ Standard_Integer aNbSG;
+
+ Standard_Integer i;
+ TopAbs_ShapeEnum aType;
+
+ TopAbs_ShapeEnum aTypeX;
TopTools_ListIteratorOfListOfShape aItLS;
TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItDMSLS;
//
// purpose :
//=======================================================================
void GEOMAlgo_Gluer2::FillBRepShapes(const TopAbs_ShapeEnum theType) {
- Standard_Boolean bHasImage, bIsToWork;
- Standard_Integer i, aNbE;
+ Standard_Boolean bHasImage;
+
+ Standard_Boolean bIsToWork;
+ Standard_Integer i;
+
+ Standard_Integer aNbE;
TopoDS_Iterator aItS;
TopoDS_Shape aEnew;
TopTools_IndexedMapOfShape aME;
// purpose :
//=======================================================================
void GEOMAlgo_Gluer2::FillContainers(const TopAbs_ShapeEnum aType) {
- Standard_Boolean bHasImage, bToReverse;
- Standard_Integer i, aNbW;
- TopoDS_Shape aWnew, aEnew;
+ Standard_Boolean bHasImage;
+
+ Standard_Boolean bToReverse;
+ Standard_Integer i;
+
+ Standard_Integer aNbW;
+ TopoDS_Shape aWnew;
+
+ TopoDS_Shape aEnew;
TopoDS_Iterator aItS;
BRep_Builder aBB;
TopTools_IndexedMapOfShape aMW;
void GEOMAlgo_Gluer2::FillCompound(const TopoDS_Shape &aC) {
Standard_Boolean bHasImage;
TopAbs_ShapeEnum aType;
- TopoDS_Shape aCnew, aCXnew;
+ TopoDS_Shape aCnew;
+
+ TopoDS_Shape aCXnew;
TopoDS_Iterator aItC;
BRep_Builder aBB;
//
//=======================================================================
void GEOMAlgo_Gluer2::BuildResult() {
Standard_Boolean bHasImage;
- TopoDS_Shape aCnew, aCXnew;
+ TopoDS_Shape aCnew;
+
+ TopoDS_Shape aCXnew;
TopoDS_Iterator aItC;
BRep_Builder aBB;
//
}
//
if (!myKeepNonSolids) {
- Standard_Integer i, aNb;
+ Standard_Integer i;
+
+ Standard_Integer aNb;
TopoDS_Shape aCnew1;
TopTools_IndexedMapOfShape aM;
//
//
aType = theS.ShapeType();
if (aType == TopAbs_EDGE) {
- TopoDS_Edge aEE, aEEnew;
+ TopoDS_Edge aEE;
+
+ TopoDS_Edge aEEnew;
//
aEE = *((TopoDS_Edge *)&theS);
MakeEdge(aEE, aEEnew);
//
theSnew = aEEnew;
} else if (aType == TopAbs_FACE) {
- TopoDS_Face aFF, aFFnew;
+ TopoDS_Face aFF;
+
+ TopoDS_Face aFFnew;
//
aFF = *((TopoDS_Face *)&theS);
MakeFace(aFF, aFFnew);
// purpose :
//=======================================================================
void GEOMAlgo_Gluer2::MakeFace(const TopoDS_Face &theF, TopoDS_Face &theFnew) {
- Standard_Boolean bIsToReverse, bIsUPeriodic;
+ Standard_Boolean bIsToReverse;
+
+ Standard_Boolean bIsUPeriodic;
Standard_Integer iRet;
- Standard_Real aTol, aUMin, aUMax, aVMin, aVMax;
+ Standard_Real aTol;
+
+ Standard_Real aUMin;
+
+ Standard_Real aUMax;
+
+ Standard_Real aVMin;
+
+ Standard_Real aVMax;
Handle(Geom_Surface) aS;
TopLoc_Location aLoc;
- TopoDS_Shape aW, aWr;
+ TopoDS_Shape aW;
+
+ TopoDS_Shape aWr;
TopoDS_Edge aEx;
- TopoDS_Face aFF, aFnew;
- TopoDS_Iterator aItW, aItE;
+ TopoDS_Face aFF;
+
+ TopoDS_Face aFnew;
+ TopoDS_Iterator aItW;
+
+ TopoDS_Iterator aItE;
BRep_Builder aBB;
TopTools_ListOfShape aLEr;
TopTools_ListIteratorOfListOfShape aItLE;
myErrorStatus = 0;
//
Standard_Boolean bIsDE;
- Standard_Real aT1, aT2;
- TopoDS_Vertex aV1, aV2, aVR1, aVR2;
+ Standard_Real aT1;
+
+ Standard_Real aT2;
+ TopoDS_Vertex aV1;
+
+ TopoDS_Vertex aV2;
+
+ TopoDS_Vertex aVR1;
+
+ TopoDS_Vertex aVR2;
TopoDS_Edge aEx;
//
bIsDE = BRep_Tool::Degenerated(aE);
void GEOMAlgo_Gluer2::MakeVertex(const TopTools_ListOfShape &aLV,
TopoDS_Vertex &aNewVertex) {
Standard_Integer aNbV;
- Standard_Real aTolV, aD, aDmax;
+ Standard_Real aTolV;
+
+ Standard_Real aD;
+
+ Standard_Real aDmax;
gp_XYZ aGC;
- gp_Pnt aP3D, aPGC;
+ gp_Pnt aP3D;
+
+ gp_Pnt aPGC;
TopoDS_Vertex aVx;
BRep_Builder aBB;
TopTools_ListIteratorOfListOfShape aIt;
//=======================================================================
const TopTools_ListOfShape &
GEOMAlgo_Gluer2::Modified(const TopoDS_Shape &theS) {
- Standard_Boolean bIsDeleted, bHasImage, bToReverse;
+ Standard_Boolean bIsDeleted;
+
+ Standard_Boolean bHasImage;
+
+ Standard_Boolean bToReverse;
TopAbs_ShapeEnum aType;
TopoDS_Shape aSim;
//
// purpose :
//=======================================================================
Standard_Boolean GEOMAlgo_Gluer2::IsDeleted(const TopoDS_Shape &theS) {
- Standard_Boolean bRet, bContains, bHasImage;
+ Standard_Boolean bRet;
+
+ Standard_Boolean bContains;
+
+ Standard_Boolean bHasImage;
//
bRet = Standard_False;
//
// purpose :
//=======================================================================
void GEOMAlgo_Gluer2::PerformShapesToWork() {
- Standard_Integer aNbSG, i, j, k, aNbC, aNb, aNbSD;
- TopTools_ListIteratorOfListOfShape aItLS1, aItLS2;
+ Standard_Integer aNbSG;
+
+ Standard_Integer i;
+
+ Standard_Integer j;
+
+ Standard_Integer k;
+
+ Standard_Integer aNbC;
+
+ Standard_Integer aNb;
+
+ Standard_Integer aNbSD;
+ TopTools_ListIteratorOfListOfShape aItLS1;
+
+ TopTools_ListIteratorOfListOfShape aItLS2;
TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItDMSLS;
GEOMAlgo_CoupleOfShapes aCS;
GEOMAlgo_ListOfCoupleOfShapes aLCS;
return;
}
//
- Standard_Integer i, aNbS1, aNbS2, aNbS;
- TopAbs_ShapeEnum aType, aTypeS;
+ Standard_Integer i;
+
+ Standard_Integer aNbS1;
+
+ Standard_Integer aNbS2;
+
+ Standard_Integer aNbS;
+ TopAbs_ShapeEnum aType;
+
+ TopAbs_ShapeEnum aTypeS;
TopTools_ListIteratorOfListOfShape aItLS;
- TopTools_IndexedMapOfShape aMS1, aMS2;
+ TopTools_IndexedMapOfShape aMS1;
+
+ TopTools_IndexedMapOfShape aMS2;
TopTools_DataMapOfShapeListOfShape aDMSLS;
TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItDMSLS;
GEOMAlgo_CoupleOfShapes aCSS;
// purpose :
//=======================================================================
void GEOMAlgo_PassKeyShape::SetShapes(const TopTools_ListOfShape &aLS) {
- Standard_Integer i, aId, aIdN;
+ Standard_Integer i;
+
+ Standard_Integer aId;
+
+ Standard_Integer aIdN;
TopTools_ListIteratorOfListOfShape aIt;
//
Clear();
//=======================================================================
Standard_Integer NormalizedId(const Standard_Integer aId,
const Standard_Integer aDiv) {
- Standard_Integer aMax, aTresh, aIdRet;
+ Standard_Integer aMax;
+
+ Standard_Integer aTresh;
+
+ Standard_Integer aIdRet;
//
aIdRet = aId;
aMax = ::IntegerLast();
TopAbs_ShapeEnum aType;
BRep_Builder aBB;
NCollection_Map<TopoDS_Shape> aM;
- NCollection_List<TopoDS_Shape>::Iterator aIt, aItIm;
+ NCollection_List<TopoDS_Shape>::Iterator aIt;
+
+ NCollection_List<TopoDS_Shape>::Iterator aItIm;
//
aIt.Initialize(myArguments);
for (; aIt.More(); aIt.Next()) {
#endif
{
if (myLimit != TopAbs_SHAPE) {
- Standard_Integer i, aNbS;
+ Standard_Integer i;
+
+ Standard_Integer aNbS;
BRep_Builder aBB;
TopoDS_Compound aC;
TopTools_IndexedMapOfShape aMx;
aBB.Add(aC, aS);
}
if (myLimitMode) {
- Standard_Integer iType, iLimit, iTypeX;
- TopAbs_ShapeEnum aType, aTypeX;
- NCollection_List<TopoDS_Shape> aLSP, aLSX;
- NCollection_List<TopoDS_Shape>::Iterator aIt, aItX, aItIm;
+ Standard_Integer iType;
+
+ Standard_Integer iLimit;
+
+ Standard_Integer iTypeX;
+ TopAbs_ShapeEnum aType;
+
+ TopAbs_ShapeEnum aTypeX;
+ NCollection_List<TopoDS_Shape> aLSP;
+
+ NCollection_List<TopoDS_Shape> aLSX;
+ NCollection_List<TopoDS_Shape>::Iterator aIt;
+
+ NCollection_List<TopoDS_Shape>::Iterator aItX;
+
+ NCollection_List<TopoDS_Shape>::Iterator aItIm;
NCollection_Map<TopoDS_Shape> aM;
//
iLimit = (Standard_Integer)myLimit;
NCollection_List<TopoDS_Shape> &aLSX) {
Standard_Integer aNbC1;
TopAbs_ShapeEnum aType;
- NCollection_List<TopoDS_Shape> aLC, aLC1;
- NCollection_List<TopoDS_Shape>::Iterator aIt, aIt1;
+ NCollection_List<TopoDS_Shape> aLC;
+
+ NCollection_List<TopoDS_Shape> aLC1;
+ NCollection_List<TopoDS_Shape>::Iterator aIt;
+
+ NCollection_List<TopoDS_Shape>::Iterator aIt1;
TopoDS_Iterator aItC;
//
aLC.Append(aC1);
aValid = !isRadiusIntersected(myCurve2, aPoint, aCenter, Standard_True);
Geom2dAPI_ProjectPointOnCurve aProj(aCenter, myCurve2);
- Standard_Integer a, aNB = aProj.NbPoints();
+ Standard_Integer a;
+
+ Standard_Integer aNB = aProj.NbPoints();
for (a = aNB; a > 0; a--) {
if (aPoint.Distance(aProj.Point(a)) < aTol)
continue;
void GEOMImpl_Fillet1d::performInterval(const Standard_Real theStart,
const Standard_Real theEnd,
const Standard_Integer theNBSteps) {
- Standard_Real aParam, aStep, aDStep;
+ Standard_Real aParam;
+
+ Standard_Real aStep;
+
+ Standard_Real aDStep;
aStep = (theEnd - theStart) / theNBSteps;
aDStep = aStep / 1000.;
Standard_Integer aCycle;
for (aCycle = 2, myStartSide = Standard_False; aCycle;
myStartSide = !myStartSide, aCycle--) {
- GEOMImpl_Fillet1dPoint *aLeft = nullptr, *aRight = nullptr;
+ GEOMImpl_Fillet1dPoint *aLeft = nullptr;
+
+ GEOMImpl_Fillet1dPoint *aRight = nullptr;
for (aParam = theStart + aStep;
aParam < theEnd || fabs(theEnd - aParam) < Precision::Confusion();
TopoDS_Edge &theEdge2) {
TopoDS_Edge aResult;
gp_Pnt2d aTargetPoint2d;
- Standard_Real aX, aY;
+ Standard_Real aX;
+
+ Standard_Real aY;
ElSLib::PlaneParameters(myPlane->Pln().Position(), thePoint, aX, aY);
aTargetPoint2d.SetCoord(aX, aY);
myPlane->Pln().Position());
Handle(Geom_Circle) aCircle = new Geom_Circle(
gp_Ax2(aCenter, myPlane->Pln().Axis().Direction()), myRadius);
- gp_Pnt2d aPoint2d1, aPoint2d2;
+ gp_Pnt2d aPoint2d1;
+
+ gp_Pnt2d aPoint2d2;
myCurve1->D0(aNearest->GetParam(), aPoint2d1);
myCurve2->D0(aNearest->GetParam2(), aPoint2d2);
gp_Pnt aPoint1 = ElSLib::PlaneValue(aPoint2d1.X(), aPoint2d1.Y(),
aResult = aBuilder.Edge();
// divide edges
- Standard_Real aStart, anEnd;
+ Standard_Real aStart;
+
+ Standard_Real anEnd;
Handle(Geom_Curve) aCurve = BRep_Tool::Curve(myEdge1, aStart, anEnd);
gp_Vec aDir;
aCurve->D1(aNearest->GetParam(), aPoint1, aDir);
GEOMImpl_Fillet1dPoint::ComputeDifference(GEOMImpl_Fillet1dPoint *thePoint) {
Standard_Integer a;
Standard_Boolean aDiffsSet = (myD.Length() != 0);
- Standard_Real aDX = thePoint->GetParam() - myParam, aDY = 0.0;
+ Standard_Real aDX = thePoint->GetParam() - myParam;
+
+ Standard_Real aDY = 0.0;
if (thePoint->myV.Length() == myV.Length()) { // absolutely the same points
for (a = 1; a <= myV.Length(); a++) {
aDY = thePoint->myV.Value(a) - myV.Value(a);
// purpose :
//=======================================================================
void GEOMImpl_Fillet1dPoint::FilterPoints(GEOMImpl_Fillet1dPoint *thePoint) {
- Standard_Integer a, b;
+ Standard_Integer a;
+
+ Standard_Integer b;
TColStd_SequenceOfReal aDiffs;
- Standard_Real aY, aY2, aDX = thePoint->GetParam() - myParam;
+ Standard_Real aY;
+
+ Standard_Real aY2;
+
+ Standard_Real aDX = thePoint->GetParam() - myParam;
for (a = 1; a <= myV.Length(); a++) {
// searching for near point from thePoint
Standard_Integer aNear = 0;
bool isSketchEntities = true;
std::set<std::string> anEntityKinds;
std::string anEntityKindsStr;
- auto anIt = theArguments.begin(), aLast = theArguments.end();
+ auto anIt = theArguments.begin();
+
+ auto aLast = theArguments.end();
for (; anIt != aLast; anIt++) {
anEntityKinds.insert(*anIt);
if (!anEntityKindsStr.empty())
if (MyShapeTypes.size() != 0) {
std::map<std::string, GeomValidators_ShapeType::TypeOfShape>::const_iterator
- anIt = MyShapeTypes.begin(),
+
+ anIt = MyShapeTypes.begin();
+
+ std::map<std::string, GeomValidators_ShapeType::TypeOfShape>::const_iterator
+
aLast = MyShapeTypes.end();
for (; anIt != aLast; anIt++)
if (anIt->second == theType) {
Events_InfoMessage &theError) const {
bool aValid = false;
- auto anIt = theArguments.begin(), aLast = theArguments.end();
+ auto anIt = theArguments.begin();
+
+ auto aLast = theArguments.end();
// returns true if the attribute satisfies at least one of given arguments
for (; anIt != aLast; anIt++) {
TypeOfShape aShapeType = shapeType(*anIt);
std::string InitializationPlugin_PyInterp::errorMessage() {
std::string aPyError;
if (PyErr_Occurred()) {
- PyObject *pstr, *ptype, *pvalue, *ptraceback;
+ PyObject *pstr;
+
+ PyObject *ptype;
+
+ PyObject *pvalue;
+
+ PyObject *ptraceback;
PyErr_Fetch(&ptype, &pvalue, &ptraceback);
PyErr_NormalizeException(&ptype, &pvalue, &ptraceback);
pstr = PyObject_Str(pvalue);
TopoDS_Shape aShape = theEdge->impl<TopoDS_Shape>();
if (!aShape.IsNull() && aShape.ShapeType() == TopAbs_EDGE) {
TopoDS_Edge anEdge = TopoDS::Edge(aShape);
- double aFirst, aLast;
+ double aFirst;
+
+ double aLast;
Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, aFirst, aLast);
if (!aCurve.IsNull()) {
TopoDS_Vertex aVertex;
std::dynamic_pointer_cast<ModelAPI_AttributeRefAttrList>(anAttr);
std::list<std::pair<ObjectPtr, AttributePtr>> aRefs = aRefAttr->list();
std::list<std::pair<ObjectPtr, AttributePtr>>::const_iterator
- anIt = aRefs.begin(),
+
+ anIt = aRefs.begin();
+
+ std::list<std::pair<ObjectPtr, AttributePtr>>::const_iterator
+
aLast = aRefs.end();
for (; anIt != aLast; anIt++) {
aReferenced.push_back(anIt->first);
}
if (aNewIter.More())
continue;
- GeomShapePtr anOldShape(new GeomAPI_Shape), aRootShape(new GeomAPI_Shape);
+ GeomShapePtr anOldShape(new GeomAPI_Shape);
+
+ GeomShapePtr aRootShape(new GeomAPI_Shape);
anOldShape->setImpl<TopoDS_Shape>(new TopoDS_Shape(anOld));
anOldShape = GeomAPI_Tools::getTypedShape(anOldShape);
}
}
if (!aCurrentToRoot.IsEmpty()) { // update the whole named shape content
- TopTools_ListOfShape anOld, aNew;
+ TopTools_ListOfShape anOld;
+
+ TopTools_ListOfShape aNew;
TNaming_Evolution anEvol = aNS->Evolution();
for (TNaming_Iterator aNSIter(aNS); aNSIter.More(); aNSIter.Next()) {
anOld.Prepend(aCurrentToRoot.IsBound(aNSIter.OldShape())
aNew.Prepend(aNSIter.NewShape());
}
TNaming_Builder aBuilder(aNS->Label());
- TopTools_ListOfShape::Iterator anOldIter(anOld), aNewIter(aNew);
+ TopTools_ListOfShape::Iterator anOldIter(anOld);
+
+ TopTools_ListOfShape::Iterator aNewIter(aNew);
for (; anOldIter.More(); anOldIter.Next(), aNewIter.Next()) {
if (anEvol == TNaming_GENERATED) {
aBuilder.Generated(anOldIter.Value(), aNewIter.Value());
// objects (to perform it in the python scripts correctly): sketch become
// current after creation of sub-elements
FeaturePtr aCurrent = currentFeature(false);
- CompositeFeaturePtr aMain, aNext = ModelAPI_Tools::compositeOwner(aCurrent);
+ CompositeFeaturePtr aMain;
+
+ CompositeFeaturePtr aNext = ModelAPI_Tools::compositeOwner(aCurrent);
while (aNext.get()) {
aMain = aNext;
aNext = ModelAPI_Tools::compositeOwner(aMain);
!myDoc->HasOpenCommand()) { // abort all what was done in nested
compactNested();
// store undo-delta here as undo actually does in the method later
- int a, aNumTransactions = myTransactions.rbegin()->myOCAFNum;
+ int a;
+
+ int aNumTransactions = myTransactions.rbegin()->myOCAFNum;
for (a = 0; a < aNumTransactions; a++) {
modifiedLabels(myDoc, aDeltaLabels);
myDoc->Undo();
std::dynamic_pointer_cast<Model_Data>(aResult->data());
if (aData.get() != nullptr) {
const std::set<AttributePtr> &aRefs = aData->refsToMe();
- auto aRefIt = aRefs.begin(), aRefLast = aRefs.end();
+ auto aRefIt = aRefs.begin();
+
+ auto aRefLast = aRefs.end();
for (; aRefIt != aRefLast; aRefIt++) {
FeaturePtr aFeature =
std::dynamic_pointer_cast<ModelAPI_Feature>((*aRefIt)->owner());
std::dynamic_pointer_cast<Model_Data>(theFeature->data());
if (aData.get() && !aData->refsToMe().empty()) {
const std::set<AttributePtr> &aRefs = aData->refsToMe();
- auto aRefIt = aRefs.begin(), aRefLast = aRefs.end();
+ auto aRefIt = aRefs.begin();
+
+ auto aRefLast = aRefs.end();
for (; aRefIt != aRefLast; aRefIt++) {
FeaturePtr aFeature =
std::dynamic_pointer_cast<ModelAPI_Feature>((*aRefIt)->owner());
Handle(TDataStd_ReferenceArray) aRefs;
if (!aFeaturesLab.FindAttribute(TDataStd_ReferenceArray::GetID(), aRefs))
return;
- TDF_Label anAfterLab,
- aMovedLab = std::dynamic_pointer_cast<Model_Data>(theMoved->data())
- ->label()
- .Father();
+ TDF_Label anAfterLab;
+
+ TDF_Label aMovedLab = std::dynamic_pointer_cast<Model_Data>(theMoved->data())
+
+ ->label()
+
+ .Father();
if (theAfterThis.get())
anAfterLab = std::dynamic_pointer_cast<Model_Data>(theAfterThis->data())
->label()
std::dynamic_pointer_cast<ModelAPI_ResultBody>(aCurrentResult);
if (!anOwner)
return ObjectPtr(); // only Body can have sub-results
- int a, aNumSubs = anOwner->numberOfSubs();
+ int a;
+
+ int aNumSubs = anOwner->numberOfSubs();
for (a = 0; a < aNumSubs; a++) {
ResultPtr aSub = anOwner->subResult(a);
if (aSub.get()) {
}
// update all objects by checking are they on labels or not
- std::set<ObjectPtr> aNewFeatures, aKeptFeatures;
+ std::set<ObjectPtr> aNewFeatures;
+
+ std::set<ObjectPtr> aKeptFeatures;
TDF_ChildIDIterator aLabIter(featuresLabel(), TDataStd_Comment::GetID());
for (; aLabIter.More(); aLabIter.Next()) {
TDF_Label aFeatureLabel = aLabIter.Value()->Label();
return false;
// labels for the folder and last feature in the list
- TDF_Label aFolderLabel, aLastFeatureLabel;
+ TDF_Label aFolderLabel;
+
+ TDF_Label aLastFeatureLabel;
std::shared_ptr<Model_Data> aData =
std::static_pointer_cast<Model_Data>(theFolder->data());
if (aData && aData->isValid())
aCurrentD->isValid()) {
TDF_Label aLaterL = aLaterD->label().Father();
TDF_Label aCurrentL = aCurrentD->label().Father();
- int aLaterI = -1, aCurentI = -1; // not found yet state
+ int aLaterI = -1;
+
+ int aCurentI = -1; // not found yet state
Handle(TDataStd_ReferenceArray) aRefs;
if (featuresLabel().FindAttribute(TDataStd_ReferenceArray::GetID(),
aRefs)) {
// searching for the best new candidate to old location
MapFaceToEdgeIndices::Iterator aNewIter(aNewIndices);
for (; aNewIter.More(); aNewIter.Next()) {
- double aBestFound = 0, aBestNotFound = 1.e+100;
+ double aBestFound = 0;
+
+ double aBestNotFound = 1.e+100;
int aBestTag = 0;
const TColStd_ListOfInteger &aNewInd = aNewIter.Value();
// old faces indices where they where located
continue; // already found a best candidate
Handle(TDataStd_IntPackedMap) anOldIndices =
Handle(TDataStd_IntPackedMap)::DownCast(anOldIter.Value());
- double aFound = 0, aNotFound = 0;
+ double aFound = 0;
+
+ double aNotFound = 0;
TColStd_ListOfInteger::Iterator aNewIndIter(aNewInd);
for (; aNewIndIter.More(); aNewIndIter.Next()) {
if (anOldIndices->Contains(aNewIndIter.Value())) {
std::wstringstream aName;
aName << "Face";
TopExp_Explorer aPutEdges(aFaceToPut, TopAbs_EDGE);
- TNaming_Builder *anEdgesBuilder = nullptr, *aVerticesBuilder = nullptr;
+ TNaming_Builder *anEdgesBuilder = nullptr;
+
+ TNaming_Builder *aVerticesBuilder = nullptr;
for (TColStd_ListOfInteger::Iterator anIter(aNewInd); anIter.More();
anIter.Next()) {
int anIndex = anIter.Value();
if (aConstr->shape() && aConstr->shape()->isEdge()) {
TopoDS_Edge anEdge =
TopoDS::Edge(aConstr->shape()->impl<TopoDS_Shape>());
- Standard_Real aFirst, aLast;
+ Standard_Real aFirst;
+
+ Standard_Real aLast;
Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, aFirst, aLast);
theCurvesIndices.Bind(aCurve, a);
theEdgesIndices.Bind(a, anEdge);
for (TopExp_Explorer anEdges(aTopoFace, TopAbs_EDGE); anEdges.More();
anEdges.Next()) {
TopoDS_Edge anEdge = TopoDS::Edge(anEdges.Current());
- Standard_Real aFirst, aLast;
+ Standard_Real aFirst;
+
+ Standard_Real aLast;
Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, aFirst, aLast);
if (theCurvesIndices.IsBound(aCurve)) {
int anIndex = theCurvesIndices.Find(aCurve);
std::dynamic_pointer_cast<ModelAPI_ObjectUpdatedMessage>(theMessage);
const std::set<ObjectPtr> &anObjs = aMsg->objects();
auto anObjIter = anObjs.cbegin();
- std::list<ObjectPtr> aFeatures, aResults;
+ std::list<ObjectPtr> aFeatures;
+
+ std::list<ObjectPtr> aResults;
for (; anObjIter != anObjs.cend(); anObjIter++) {
if (std::dynamic_pointer_cast<Model_Document>((*anObjIter)->document())
->executeFeatures()) {
std::shared_ptr<GeomDataAPI_Point> anOrigin =
std::dynamic_pointer_cast<GeomDataAPI_Point>(
theFeature->attribute("Origin"));
- double anOX = anOrigin->x(), anOY = anOrigin->y(), anOZ = anOrigin->z();
+ double anOX = anOrigin->x();
+
+ double anOY = anOrigin->y();
+
+ double anOZ = anOrigin->z();
std::shared_ptr<GeomDataAPI_Dir> aDir =
std::dynamic_pointer_cast<GeomDataAPI_Dir>(
theFeature->attribute("DirX"));
- double aDX = aDir->x(), aDY = aDir->y(), aDZ = aDir->z();
+ double aDX = aDir->x();
+
+ double aDY = aDir->y();
+
+ double aDZ = aDir->z();
std::shared_ptr<GeomDataAPI_Dir> aNorm =
std::dynamic_pointer_cast<GeomDataAPI_Dir>(
theFeature->attribute("Norm"));
- double aNX = aNorm->x(), aNY = aNorm->y(), aNZ = aNorm->z();
+ double aNX = aNorm->x();
+
+ double aNY = aNorm->y();
+
+ double aNZ = aNorm->z();
// update sketch plane
updateArguments(theFeature);
theFeature->attributeChanged(
std::map<std::string, std::set<std::string>>();
aFindAttrID = aFindFeature->second.find(theAttribute);
}
- auto aCasesIt = theCases.begin(), aCasesLast = theCases.end();
+ auto aCasesIt = theCases.begin();
+
+ auto aCasesLast = theCases.end();
std::map<std::string, std::set<std::string>> aFindCases = aFindAttrID->second;
for (; aCasesIt != aCasesLast; aCasesIt++) {
std::pair<std::string, std::string> aCasePair = *aCasesIt;
if (aFindFeature != myCases.end()) {
auto aFindAttrID = aFindFeature->second.find(theAttribute);
if (aFindAttrID != aFindFeature->second.end()) {
- auto aCasesIt = aFindAttrID->second.begin(),
- aCasesLast = aFindAttrID->second.end();
+ auto aCasesIt = aFindAttrID->second.begin();
+
+ auto aCasesLast = aFindAttrID->second.end();
for (; aCasesIt != aCasesLast && anInCase; aCasesIt++) {
// the the switch-attribute that contains the case value
AttributeStringPtr aSwitch = theFeature->string(aCasesIt->first);
bool removeFeatures(const std::set<FeaturePtr> &theFeatures,
const bool theFlushRedisplay) {
bool isDone = false;
- auto anIt = theFeatures.begin(), aLast = theFeatures.end();
+ auto anIt = theFeatures.begin();
+
+ auto aLast = theFeatures.end();
for (; anIt != aLast; anIt++) {
FeaturePtr aFeature = *anIt;
if (aFeature.get()) {
// references to it
std::set<FeaturePtr> aMainReferences = theReferencesMap.at(theFeature);
- auto anIt = aMainReferences.begin(), aLast = aMainReferences.end();
+ auto anIt = aMainReferences.begin();
+
+ auto aLast = aMainReferences.end();
for (; anIt != aLast; anIt++) {
FeaturePtr aRefFeature = *anIt;
if (theReferences.find(aRefFeature) == theReferences.end()) {
if (theRecLevel > RECURSE_TOP_LEVEL)
return;
theRecLevel++;
- auto anIt = theFeatures.begin(), aLast = theFeatures.end();
+ auto anIt = theFeatures.begin();
+
+ auto aLast = theFeatures.end();
for (; anIt != aLast; anIt++) {
FeaturePtr aFeature = *anIt;
if (aFeature.get() && theReferences.find(aFeature) == theReferences.end()) {
} else { // filter references to skip composition features of the current
// feature
std::set<FeaturePtr> aFilteredFeatures;
- auto aRefIt = aSelRefFeatures.begin(), aRefLast = aSelRefFeatures.end();
+ auto aRefIt = aSelRefFeatures.begin();
+
+ auto aRefLast = aSelRefFeatures.end();
for (; aRefIt != aRefLast; aRefIt++) {
FeaturePtr aCFeature = *aRefIt;
CompositeFeaturePtr aComposite =
// ext_2(bool_1)
// sk_3()
std::map<FeaturePtr, std::set<FeaturePtr>>::const_iterator
- aMainIt = aMainList.begin(),
+
+ aMainIt = aMainList.begin();
+
+ std::map<FeaturePtr, std::set<FeaturePtr>>::const_iterator
+
aMainLast = aMainList.end();
for (; aMainIt != aMainLast; aMainIt++) {
FeaturePtr aMainListFeature = aMainIt->first;
<< getFeatureInfo(aMainListFeature)
<< ", references size = " << aSize << std::endl;
#endif
- auto anIt = aMainRefList.begin(), aLast = aMainRefList.end();
+ auto anIt = aMainRefList.begin();
+
+ auto aLast = aMainRefList.end();
std::set<FeaturePtr> aResultRefList;
aResultRefList.insert(aMainRefList.begin(), aMainRefList.end());
for (; anIt != aLast; anIt++) {
const std::set<FeaturePtr> &theFeatures,
const std::map<FeaturePtr, std::set<FeaturePtr>> &theReferences,
std::set<FeaturePtr> &theFeaturesRefsTo) {
- auto anIt = theFeatures.begin(), aLast = theFeatures.end();
+ auto anIt = theFeatures.begin();
+
+ auto aLast = theFeatures.end();
for (; anIt != aLast; anIt++) {
FeaturePtr aFeature = *anIt;
if (theReferences.find(aFeature) == theReferences.end())
continue;
std::set<FeaturePtr> aRefList = theReferences.at(aFeature);
- auto aRefIt = aRefList.begin(), aRefLast = aRefList.end();
+ auto aRefIt = aRefList.begin();
+
+ auto aRefLast = aRefList.end();
for (; aRefIt != aRefLast; aRefIt++) {
FeaturePtr aRefFeature = *aRefIt;
CompositeFeaturePtr aComposite =
aRefs;
theFeature->data()->referencesToObjects(aRefs);
std::list<std::pair<std::string, std::list<ObjectPtr>>>::const_iterator
- anIt = aRefs.begin(),
+
+ anIt = aRefs.begin();
+
+ std::list<std::pair<std::string, std::list<ObjectPtr>>>::const_iterator
+
aLast = aRefs.end();
std::set<ResultPtr> alreadyThere; // to avoid duplications
for (; anIt != aLast; anIt++) {
anIt->first))
continue; // use only concealed attributes
std::list<ObjectPtr> anObjects = (*anIt).second;
- std::list<ObjectPtr>::const_iterator anOIt = anObjects.begin(),
- anOLast = anObjects.end();
+ std::list<ObjectPtr>::const_iterator anOIt = anObjects.begin();
+
+ std::list<ObjectPtr>::const_iterator anOLast = anObjects.end();
for (; anOIt != anOLast; anOIt++) {
ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(*anOIt);
if (aResult && aResult->isConcealed()) {
: (*(theMoved.cbegin()))->document();
std::set<FeaturePtr> aMoved(theMoved.begin(),
theMoved.end()); // fast access to moved
- std::set<FeaturePtr> aPassed,
+ std::set<FeaturePtr> aPassed;
+
+ std::set<FeaturePtr>
aPassedMoved; // all features and all moved before the current one
std::set<FeaturePtr> aPassedAfter; // all passed features after theAfter
bool anAfterIsPassed =
if (aRefFeature->getKind() == theReferenceFeatureKind) {
std::list<AttributePtr> anAttributes =
aRefFeature->data()->attributes(ModelAPI_AttributeRefAttr::typeId());
- auto anIter = anAttributes.begin(), aLast = anAttributes.end();
+ auto anIter = anAttributes.begin();
+
+ auto aLast = anAttributes.end();
bool isSkippedAttribute = false;
if (isSkipFeatureAttributes) {
for (anIter = anAttributes.begin();
aFeatureShape = (*anEdgeShapes.begin())->shape();
}
- auto anIt = theFeatures.begin(), aLast = theFeatures.end();
+ auto anIt = theFeatures.begin();
+
+ auto aLast = theFeatures.end();
for (; anIt != aLast; anIt++) {
FeaturePtr aFeature = *anIt;
if (aFeature.get() == theBaseFeature.get())
#ifdef DEBUG_POINT_INSIDE_SHAPE
std::cout << "ModelGeomAlgo_Point2D::getPointsInsideShape:" << std::endl;
#endif
- auto anIt = theAttributes.begin(), aLast = theAttributes.end();
+ auto anIt = theAttributes.begin();
+
+ auto aLast = theAttributes.end();
for (; anIt != aLast; anIt++) {
std::shared_ptr<GeomDataAPI_Point2D> anAttribute = *anIt;
std::shared_ptr<GeomAPI_Pnt2d> aPnt2d = anAttribute->pnt();
std::list<std::shared_ptr<GeomAPI_Pnt>> &thePoints,
std::map<std::shared_ptr<GeomDataAPI_Point2D>, std::shared_ptr<GeomAPI_Pnt>>
&theAttributeToPoint) {
- auto anIt = theAttributes.begin(), aLast = theAttributes.end();
+ auto anIt = theAttributes.begin();
+
+ auto aLast = theAttributes.end();
for (; anIt != aLast; anIt++) {
std::shared_ptr<GeomDataAPI_Point2D> anAttribute = *anIt;
std::shared_ptr<GeomAPI_Pnt2d> aPnt2d = anAttribute->pnt();
static bool isPointWithinBB(const GeomPointPtr &thePoint,
const GeomShapePtr &theShape,
const double theTolerance) {
- double aXMin, aXMax, aYMin, aYMax, aZMin, aZMax;
+ double aXMin;
+
+ double aXMax;
+
+ double aYMin;
+
+ double aYMax;
+
+ double aZMin;
+
+ double aZMax;
return theShape->computeSize(aXMin, aYMin, aZMin, aXMax, aYMax, aZMax) &&
thePoint->x() >= aXMin - theTolerance &&
thePoint->x() <= aXMax + theTolerance &&
return true;
}
- std::string aSection, aName, aDefault;
+ std::string aSection;
+
+ std::string aName;
+
+ std::string aDefault;
theResult->colorConfigInfo(aSection, aName, aDefault);
// dump current color
ModelHighAPI_Dumper::operator<<(const AttributePtr &theAttr) {
FeaturePtr anOwner = ModelAPI_Feature::feature(theAttr->owner());
- std::string aWrapperPrefix, aWrapperSuffix;
+ std::string aWrapperPrefix;
+
+ std::string aWrapperSuffix;
// Check the attribute belongs to copied (in multi-translation or
// multi-rotation) feature. In this case we need to cast explicitly feature to
// appropriate type.
//--------------------------------------------------------------------------------------
std::shared_ptr<GeomAPI_Ax3> defaultPlane(const std::wstring &theName) {
std::shared_ptr<GeomAPI_Pnt> o(new GeomAPI_Pnt(0, 0, 0));
- std::shared_ptr<GeomAPI_Dir> n, x;
+ std::shared_ptr<GeomAPI_Dir> n;
+
+ std::shared_ptr<GeomAPI_Dir> x;
if (theName == L"XOY") {
n.reset(new GeomAPI_Dir(0, 0, 1));
x.reset(new GeomAPI_Dir(1, 0, 0));
if (!myWorkshop->canStartOperation(theCmdId, isCommitted))
return;
- std::string aXmlCfg, aDescription;
+ std::string aXmlCfg;
+
+ std::string aDescription;
getXMLRepresentation(theCmdId.toStdString(), aXmlCfg, aDescription);
SessionPtr aMgr = ModelAPI_Session::get();
return QString::fromUtf8(aMsg.c_str());
}
-void ModuleBase_IModule::grantedOperationIds(ModuleBase_Operation *theOperation,
- QStringList &theIds) const {}
+void ModuleBase_IModule::grantedOperationIds(
+ ModuleBase_Operation * /*theOperation*/, QStringList & /*theIds*/) const {}
ModuleBase_Operation *
ModuleBase_IModule::getNewOperation(const std::string &theFeatureId) {
}
}
- std::string aXmlCfg, aDescription;
+ std::string aXmlCfg;
+
+ std::string aDescription;
getXMLRepresentation(theFeatureId, aXmlCfg, aDescription);
aFOperation->getDescription()->setDescription(
QString::fromStdString(aDescription));
/// Realizes some functionality by an operation start
/// \param theOperation a started operation
- virtual void operationStarted(ModuleBase_Operation *theOperation) {}
+ virtual void operationStarted(ModuleBase_Operation * /*theOperation*/) {}
/// Realizes some functionality by an operation resume
/// By default it emits operationResumed signal
virtual void operationResumed(ModuleBase_Operation *theOperation);
/// Realizes some functionality by an operation stop
- virtual void operationStopped(ModuleBase_Operation *theOperation) {}
+ virtual void operationStopped(ModuleBase_Operation * /*theOperation*/) {}
/// Realizes some functionality by an operation commit
- virtual void operationCommitted(ModuleBase_Operation *theOperation) {}
+ virtual void operationCommitted(ModuleBase_Operation * /*theOperation*/) {}
/// Realizes some functionality by an operation abort
- virtual void operationAborted(ModuleBase_Operation *theOperation) {}
+ virtual void operationAborted(ModuleBase_Operation * /*theOperation*/) {}
/// Realizes some functionality by an operation start
virtual ModuleBase_Operation *currentOperation() const = 0;
/// Add menu items for object browser into the given menu
/// \param theMenu a popup menu to be shown in the object browser
- virtual void addObjectBrowserMenu(QMenu *theMenu) const {};
+ virtual void addObjectBrowserMenu(QMenu * /*theMenu*/) const {};
/// Creates custom widgets for property panel
/// \param theType a type of widget
/// Call back forlast tuning of property panel before operation performance
/// It is called as on clearing of property panel as on filling with new
/// widgets
- virtual void propertyPanelDefined(ModuleBase_Operation *theOperation) {}
+ virtual void propertyPanelDefined(ModuleBase_Operation * /*theOperation*/) {}
/// Have an opportunity to create widgets for the current operation
/// instead of standard creation in workshop
/// Returns a list of modes, where the AIS objects should be activated
/// \param theModes a list of modes
- virtual void activeSelectionModes(QIntList &theModes) {}
+ virtual void activeSelectionModes(QIntList & /*theModes*/) {}
/// Appends specific selection modes for the module to the list of types
/// \param theModesType combination of available selection filters
/// \param theFlag a flag of level of customization, which means that only
/// part of sub-elements \param theUpdateViewer the parameter whether the
/// viewer should be update immediately
- virtual void activateCustomPrs(const FeaturePtr &theFeature,
- const ModuleBase_CustomizeFlag &theFlag,
- const bool theUpdateViewer) {}
+ virtual void activateCustomPrs(const FeaturePtr & /*theFeature*/,
+ const ModuleBase_CustomizeFlag & /*theFlag*/,
+ const bool /*theUpdateViewer*/) {}
/// Deactivate custom presentation for the object. Default realization is
/// empty. \param theFlag a flag of level of customization, which means that
/// only part of sub-elements \param theUpdateViewer the parameter whether the
/// viewer should be update immediately
- virtual void deactivateCustomPrs(const ModuleBase_CustomizeFlag &theFlag,
- const bool theUpdateViewer) {}
+ virtual void deactivateCustomPrs(const ModuleBase_CustomizeFlag & /*theFlag*/,
+ const bool /*theUpdateViewer*/) {}
/// Modifies the given presentation in the custom way.
// virtual bool customisePresentation(std::shared_ptr<ModelAPI_Result>
/// Disable displaying of custom mode
/// \param theMode a mode to disable
- virtual void disableCustomMode(ModuleBase_CustomizeFlag theMode) {}
+ virtual void disableCustomMode(ModuleBase_CustomizeFlag /*theMode*/) {}
/// Enables disabled custom mode
virtual void enableCustomModes() {}
/// This method is called on object browser creation for customization of
/// module specific features \param theObjectBrowser a pinter on Object
/// Browser widget
- virtual void customizeObjectBrowser(QWidget *theObjectBrowser) {}
+ virtual void customizeObjectBrowser(QWidget * /*theObjectBrowser*/) {}
/// Creates a new operation
/// \param theCmdId the operation name
/// Customize presentation according to objects attributes
/// \param theObject an object for presentation
/// \param thePrs a presentation object
- virtual void customizePresentation(const ObjectPtr &theObject,
- const AISObjectPtr &thePrs) const {}
+ virtual void customizePresentation(const ObjectPtr & /*theObject*/,
+ const AISObjectPtr & /*thePrs*/) const {}
//! Returns data object by AIS
virtual ObjectPtr findPresentedObject(const AISObjectPtr &theAIS) const = 0;
/// Update state of pop-up menu items in object browser
/// \param theStdActions - a map of standard actions
virtual void
- updateObjectBrowserMenu(const QMap<QString, QAction *> &theStdActions) {}
+ updateObjectBrowserMenu(const QMap<QString, QAction *> & /*theStdActions*/) {}
/// Update state of pop-up menu items in viewer
/// \param theStdActions - a map of standard actions
- virtual void updateViewerMenu(const QMap<QString, QAction *> &theStdActions) {
- }
+ virtual void
+ updateViewerMenu(const QMap<QString, QAction *> & /*theStdActions*/) {}
/// Returns true if the action should be always enabled
/// \param theActionId an action index: Accept or Accept All
/// Connects or disconnects to the value changed signal of the property panel
/// widgets \param theWidget a property contol widget \param isToConnect a
/// boolean value whether connect or disconnect
- virtual void connectToPropertyPanel(ModuleBase_ModelWidget *theWidget,
- const bool isToConnect){};
+ virtual void connectToPropertyPanel(ModuleBase_ModelWidget * /*theWidget*/,
+ const bool /*isToConnect*/){};
/// Validates the operation to change the "Apply" button state.
/// \param thePreviousState the previous state of the widget
- virtual void widgetStateChanged(int thePreviousState){};
+ virtual void widgetStateChanged(int /*thePreviousState*/){};
/// Returns true if the event is processed.
/// \param thePreviousAttributeID an index of the previous active attribute
/// Performs some GUI actions before an operation transaction is stopped
/// Default realization is empty
- virtual void beforeOperationStopped(ModuleBase_Operation *theOperation){};
+ virtual void
+ beforeOperationStopped(ModuleBase_Operation * /*theOperation*/){};
/// Finds a shape by attribute if it is possible
/// \param theAttribute an attribute
/// Slot called on object display
/// \param theObject a data object
/// \param theAIS a presentation object
- virtual void onObjectDisplayed(ObjectPtr theObject, AISObjectPtr theAIS) {}
+ virtual void onObjectDisplayed(ObjectPtr /*theObject*/,
+ AISObjectPtr /*theAIS*/) {}
/// Slot called on before object erase
/// \param theObject a data object
/// \param theAIS a presentation object
- virtual void onBeforeObjectErase(ObjectPtr theObject, AISObjectPtr theAIS) {}
+ virtual void onBeforeObjectErase(ObjectPtr /*theObject*/,
+ AISObjectPtr /*theAIS*/) {}
/// Called on transformation in current viewer
/// \param theTrsfType type of tranformation
- virtual void onViewTransformed(int theTrsfType = 2) {}
+ virtual void onViewTransformed(int /*theTrsfType*/ = 2) {}
protected slots:
/// Called on selection changed event
QList<ModuleBase_ViewerPrsPtr>
ModuleBase_ISelection::getViewerPrs(const QObjectPtrList &theObjects) {
QList<ModuleBase_ViewerPrsPtr> aSelectedPrs;
- QObjectPtrList::const_iterator anIt = theObjects.begin(),
- aLast = theObjects.end();
+ QObjectPtrList::const_iterator anIt = theObjects.begin();
+
+ QObjectPtrList::const_iterator aLast = theObjects.end();
for (; anIt != aLast; anIt++) {
ObjectPtr anObject = *anIt;
if (anObject.get() != nullptr) {
void ModuleBase_ISelection::filterSelectionOnEqualPoints(
QList<ModuleBase_ViewerPrsPtr> &theSelected) {
QList<ModuleBase_ViewerPrsPtr> aCandidatesToRemove;
- QList<ModuleBase_ViewerPrsPtr>::const_iterator anIt = theSelected.begin(),
- aLast = theSelected.end();
+ QList<ModuleBase_ViewerPrsPtr>::const_iterator anIt = theSelected.begin();
+
+ QList<ModuleBase_ViewerPrsPtr>::const_iterator aLast = theSelected.end();
QList<ModuleBase_ViewerPrsPtr>::const_iterator aSubIt;
std::set<std::shared_ptr<GeomAPI_Vertex>> aVerticesMap;
getPresentationVertex(aPrs);
if (aGeomPrsVertex.get()) {
const auto &aPrsVertex = aGeomPrsVertex->impl<TopoDS_Vertex>();
- auto aVIt = aVerticesMap.begin(), aVLast = aVerticesMap.end();
+ auto aVIt = aVerticesMap.begin();
+
+ auto aVLast = aVerticesMap.end();
bool aFound = false;
for (; aVIt != aVLast && !aFound; aVIt++) {
std::shared_ptr<GeomAPI_Vertex> aGeomVertex = *aVIt;
}
}
QList<ModuleBase_ViewerPrsPtr>::const_iterator aRemIt = aCandidatesToRemove
- .begin(),
- aRemLast =
- aCandidatesToRemove.end();
+
+ .begin();
+
+ QList<ModuleBase_ViewerPrsPtr>::const_iterator aRemLast =
+
+ aCandidatesToRemove.end();
for (; aRemIt != aRemLast; aRemIt++) {
theSelected.removeAll(*aRemIt);
}
/// Returns a container of possible page types, which this creator can process
/// The default implementation is empty
/// \param theTypes a list of type names
- virtual void pageTypes(std::set<std::string> &theTypes) {}
+ virtual void pageTypes(std::set<std::string> & /*theTypes*/) {}
/// Returns a container of possible widget types, which this creator can
/// process \param theTypes a list of type names
- virtual void widgetTypes(std::set<std::string> &theTypes) {}
+ virtual void widgetTypes(std::set<std::string> & /*theTypes*/) {}
/// Create panel control by its type.
/// The default implementation is empty
qDebug("ModuleBase_ModelWidget::focusTo");
#endif
QList<QWidget *> aControls = getControls();
- QList<QWidget *>::const_iterator anIt = aControls.begin(),
- aLast = aControls.end();
+ QList<QWidget *>::const_iterator anIt = aControls.begin();
+
+ QList<QWidget *>::const_iterator aLast = aControls.end();
bool isFocusAccepted = false;
for (; anIt != aLast && !isFocusAccepted; anIt++) {
QWidget *aWidget = *anIt;
/// Returns values which should be highlighted when the whidget is active
/// \param theValues a list of presentations
- virtual void
- getHighlighted(QList<std::shared_ptr<ModuleBase_ViewerPrs>> &theValues){};
+ virtual void getHighlighted(
+ QList<std::shared_ptr<ModuleBase_ViewerPrs>> & /*theValues*/){};
/// Checks if the selection presentation is valid in widget
/// \param theValue a selected presentation in the view
FeaturePtr anObjectFeature = ModelAPI_Feature::feature(theObj);
std::list<AttributePtr> anAttributes =
aFeature->data()->attributes(ModelAPI_AttributeRefList::typeId());
- std::list<AttributePtr>::const_iterator anIt = anAttributes.begin(),
- aLast = anAttributes.end();
+ std::list<AttributePtr>::const_iterator anIt = anAttributes.begin();
+
+ std::list<AttributePtr>::const_iterator aLast = anAttributes.end();
bool aFoundObject = false;
for (; anIt != aLast && !aFoundObject; anIt++) {
std::shared_ptr<ModelAPI_AttributeRefList> aCurSelList =
void ModuleBase_ParamSpinBox::showCompletion(bool checkPrefix) {
myCompletePos = lineEdit()->cursorPosition();
- int aStart, aEnd;
+ int aStart;
+
+ int aEnd;
QString aPrefix;
aPrefix = getPrefix(aStart, aEnd);
if (checkPrefix) {
void ModuleBase_ParamSpinBox::insertCompletion(const QString &theText) {
QString aText = lineEdit()->text();
- int aStart, aEnd;
+ int aStart;
+
+ int aEnd;
QString aPrefix = getPrefix(aStart, aEnd);
QString aResult;
void ModuleBase_PreferencesMgr::changedResources(const ResourceMap &theMap) {
myModified.clear();
ResourceMap::ConstIterator it;
- QString sec, param;
+ QString sec;
+
+ QString param;
for (it = theMap.begin(); it != theMap.end(); ++it) {
ModuleBase_Pref aPref;
it.key()->resource(aPref.first, aPref.second);
// draw curve direction (issue 0021087)
anEdgeE.Orientation(TopAbs_FORWARD);
- TopoDS_Vertex aV1, aV2;
+ TopoDS_Vertex aV1;
+
+ TopoDS_Vertex aV2;
TopExp::Vertices(anEdgeE, aV1, aV2);
gp_Pnt aP1 = BRep_Tool::Pnt(aV1);
gp_Pnt aP2 = BRep_Tool::Pnt(aV2);
- double fp, lp;
+ double fp;
+
+ double lp;
gp_Vec aDirVec;
Handle(Geom_Curve) C = BRep_Tool::Curve(anEdgeE, fp, lp);
const FeaturePtr &theFeature) {
std::string anAttributeId;
- std::string aXmlCfg, aDescription;
+ std::string aXmlCfg;
+
+ std::string aDescription;
theWorkshop->module()->getXMLRepresentation(theFeature->getKind(), aXmlCfg,
aDescription);
bool aFoundModuleDocumentObject = false;
DocumentPtr aModuleDoc = ModelAPI_Session::get()->moduleDocument();
- auto anIt = theFeatures.begin(), aLast = theFeatures.end();
+ auto anIt = theFeatures.begin();
+
+ auto aLast = theFeatures.end();
for (; anIt != aLast && !aFoundModuleDocumentObject; anIt++) {
FeaturePtr aFeature = *anIt;
ResultPtr aResult = ModuleBase_Tools::firstResult(aFeature);
std::set<FeaturePtr> aFeaturesRefsToParameter;
std::set<FeaturePtr> aParameterFeatures;
QStringList aPartFeatureNames;
- auto anIt = theFeatures.begin(), aLast = theFeatures.end();
+ auto anIt = theFeatures.begin();
+
+ auto aLast = theFeatures.end();
// separate features to references to parameter features and references to
// others
for (; anIt != aLast; anIt++) {
std::set<FeaturePtr> aRefFeatures;
std::set<FeaturePtr> aRefList = theReferences.at(aFeature);
- auto aRefIt = aRefList.begin(), aRefLast = aRefList.end();
+ auto aRefIt = aRefList.begin();
+
+ auto aRefLast = aRefList.end();
for (; aRefIt != aRefLast; aRefIt++) {
FeaturePtr aRefFeature = *aRefIt;
if (theFeatures.find(aRefFeature) ==
aMessageBox.setStandardButtons(QMessageBox::No | QMessageBox::Yes);
aMessageBox.setDefaultButton(QMessageBox::No);
- QString aText, aDetailedText;
+ QString aText;
+
+ QString aDetailedText;
if (!thePrefixInfo.empty())
aText = thePrefixInfo.c_str();
QString aSep = ", ";
//**************************************************************
void convertToFeatures(const QObjectPtrList &theObjects,
std::set<FeaturePtr> &theFeatures) {
- QObjectPtrList::const_iterator anIt = theObjects.begin(),
- aLast = theObjects.end();
+ QObjectPtrList::const_iterator anIt = theObjects.begin();
+
+ QObjectPtrList::const_iterator aLast = theObjects.end();
for (; anIt != aLast; anIt++) {
ObjectPtr anObject = *anIt;
FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(anObject);
//**************************************************************
void convertToFolders(const QObjectPtrList &theObjects,
std::set<FolderPtr> &theFolders) {
- QObjectPtrList::const_iterator anIt = theObjects.begin(),
- aLast = theObjects.end();
+ QObjectPtrList::const_iterator anIt = theObjects.begin();
+
+ QObjectPtrList::const_iterator aLast = theObjects.end();
for (; anIt != aLast; anIt++) {
ObjectPtr anObject = *anIt;
FolderPtr aFeature = std::dynamic_pointer_cast<ModelAPI_Folder>(anObject);
if (theAttribute.get() != nullptr) {
FeaturePtr aFeature = ModelAPI_Feature::feature(theAttribute->owner());
if (aFeature.get()) {
- std::string aXmlCfg, aDescription;
+ std::string aXmlCfg;
+
+ std::string aDescription;
theWorkshop->module()->getXMLRepresentation(aFeature->getKind(), aXmlCfg,
aDescription);
std::set<ResultBodyPtr> aParents;
ModelAPI_Tools::getConcealedResults(myBaseFeature, aResults);
std::list<std::shared_ptr<ModelAPI_Result>>::const_iterator
- anIt = aResults.begin(),
+
+ anIt = aResults.begin();
+
+ std::list<std::shared_ptr<ModelAPI_Result>>::const_iterator
+
aLast = aResults.end();
for (; anIt != aLast; anIt++) {
ResultPtr aResult = *anIt;
void ModuleBase_WidgetCreatorFactory::registerCreator(
const WidgetCreatorPtr &theCreator) {
- std::set<std::string>::const_iterator anIt, aLast;
+ std::set<std::string>::const_iterator anIt;
+
+ std::set<std::string>::const_iterator aLast;
/// fill map of panels
std::set<std::string> aPanelTypes;
theCreator->panelTypes(aPanelTypes);
bool storeValueCustom() override;
//! Switch On/Off highlighting of the widget
- void setHighlighted(bool isHighlighted) override {}
+ void setHighlighted(bool /*isHighlighted*/) override {}
protected:
ModuleBase_LabelValue *myLabel; ///< A label control
QList<ModuleBase_ViewerPrsPtr> anInvalidValues;
QList<ModuleBase_ViewerPrsPtr> anAttributeValues;
- QList<ModuleBase_ViewerPrsPtr>::const_iterator anIt = theValues.begin(),
- aLast = theValues.end();
+ QList<ModuleBase_ViewerPrsPtr>::const_iterator anIt = theValues.begin();
+
+ QList<ModuleBase_ViewerPrsPtr>::const_iterator aLast = theValues.end();
for (; anIt != aLast; anIt++) {
ModuleBase_ViewerPrsPtr aValue = *anIt;
// do not validate and append to attribute selection presentation if it
aRefListAttr->remove(anIndicesToBeRemoved);
} else if (aType == ModelAPI_AttributeRefAttrList::typeId()) {
std::set<AttributePtr> anAttributes;
- QList<ModuleBase_ViewerPrsPtr>::const_iterator anIt = theValues.begin(),
- aLast = theValues.end();
+ QList<ModuleBase_ViewerPrsPtr>::const_iterator anIt = theValues.begin();
+
+ QList<ModuleBase_ViewerPrsPtr>::const_iterator aLast = theValues.end();
ObjectPtr anObject;
GeomShapePtr aShape;
for (; anIt != aLast; anIt++) {
// convert prs list to objects map
std::map<ObjectPtr, std::set<GeomShapePtr>> aGeomSelection;
std::set<GeomShapePtr> aShapes;
- QList<ModuleBase_ViewerPrsPtr>::const_iterator anIt = theValues.begin(),
- aLast = theValues.end();
+ QList<ModuleBase_ViewerPrsPtr>::const_iterator anIt = theValues.begin();
+
+ QList<ModuleBase_ViewerPrsPtr>::const_iterator aLast = theValues.end();
ObjectPtr anObject;
GeomShapePtr aShape;
GeomShapePtr anEmptyShape(new GeomAPI_Shape());
}
if (theGeomSelection.find(theObject) != theGeomSelection.end()) { // found
const std::set<GeomShapePtr> &aShapes = theGeomSelection.at(theObject);
- auto anIt = aShapes.begin(), aLast = aShapes.end();
+ auto anIt = aShapes.begin();
+
+ auto aLast = aShapes.end();
for (; anIt != aLast && !aFound; anIt++) {
GeomShapePtr aCShape = *anIt;
if (aCShape.get()) {
ModuleBase_WidgetSelectionFilter::SelectorFeature = feature();
ModuleBase_WidgetSelectionFilter::AttributeId = attributeID();
- std::string aXmlCfg, aDescription;
+ std::string aXmlCfg;
+
+ std::string aDescription;
myWorkshop->module()->getXMLRepresentation(myUseFilters, aXmlCfg,
aDescription);
}
}
- QIntList::const_iterator anIt = aShapeTypes.begin(),
- aLast = aShapeTypes.end();
+ QIntList::const_iterator anIt = aShapeTypes.begin();
+
+ QIntList::const_iterator aLast = aShapeTypes.end();
for (; anIt != aLast && !aValid; anIt++) {
auto aCurrentShapeType = (TopAbs_ShapeEnum)*anIt;
if (aShapeType == aCurrentShapeType)
bool aValid = false;
// stores the current values of the widget attribute
- bool isFlushesActived, isAttributeSetInitializedBlocked,
- isAttributeSendUpdatedBlocked;
+ bool isFlushesActived;
+
+ bool isAttributeSetInitializedBlocked;
+
+ bool isAttributeSendUpdatedBlocked;
blockAttribute(theAttribute, true, isFlushesActived,
isAttributeSetInitializedBlocked,
QList<ModuleBase_ViewerPrsPtr> aValidatedValues;
// Collect compsolids.
- QList<ModuleBase_ViewerPrsPtr>::const_iterator anIt = theValues.begin(),
- aLast = theValues.end();
+ QList<ModuleBase_ViewerPrsPtr>::const_iterator anIt = theValues.begin();
+
+ QList<ModuleBase_ViewerPrsPtr>::const_iterator aLast = theValues.end();
for (; anIt != aLast; anIt++) {
const ModuleBase_ViewerPrsPtr &aViewerPrs = *anIt;
ObjectPtr anObject = aViewerPrs->object();
}
}
QList<double> aShapeData;
- double aRangeMin = aFieldStepData.first(), aRangeMax = aFieldStepData.last();
+ double aRangeMin = aFieldStepData.first();
+
+ double aRangeMax = aFieldStepData.last();
if (aCols == 1) {
for (int aRow = 0; aRow < aRows - aStart; aRow++) {
double aValue = aFieldStepData.at(aRow);
switch (aType) {
case ModelAPI_AttributeTables::DOUBLE:
case ModelAPI_AttributeTables::INTEGER: {
- double aMin, aMax;
+ double aMin;
+
+ double aMax;
QList<double> aShapeData = range(aMin, aMax);
AttributeSelectionListPtr aSelList =
int aNbPoints = 0;
if (theShape.ShapeType() == TopAbs_EDGE) {
- double f, l;
+ double f;
+
+ double l;
Handle(Geom_Curve) curve = BRep_Tool::Curve(TopoDS::Edge(theShape), f, l);
if (!curve.IsNull()) {
theCenter = curve->Value(0.5 * (f + l));
if (!triangulation.IsNull() && triangulation->HasUVNodes()) {
gp_XY C(0, 0);
double A = 0;
- int n1, n2, n3;
+ int n1;
+
+ int n2;
+
+ int n3;
for (int iT = 1; iT <= triangulation->NbTriangles(); ++iT) {
triangulation->Triangle(iT).Get(n1, n2, n3);
const gp_Pnt2d &uv1 = triangulation->UVNode(n1);
if (aGroup == ModelAPI_Folder::group()) {
static QString anIconString(":pictures/features_folder.png");
- int aFirst = -1, aLast = -1;
+ int aFirst = -1;
+
+ int aLast = -1;
PartSet_Tools::getFirstAndLastIndexInFolder(theObj, aFirst, aLast);
if ((aFirst != -1) && (aLast != -1)) {
int aNbItems = aLast - aFirst + 1;
static const Events_ID anVisualEvent =
Events_Loop::eventByName(EVENT_VISUAL_ATTRIBUTES);
if (anObjects.size() > 0) {
- QObjectPtrList::const_iterator anIt = anObjects.begin(),
- aLast = anObjects.end();
+ QObjectPtrList::const_iterator anIt = anObjects.begin();
+
+ QObjectPtrList::const_iterator aLast = anObjects.end();
for (; anIt != aLast; anIt++) {
FeaturePtr aFeature = ModelAPI_Feature::feature(*anIt);
if (aFeature.get() != nullptr) {
bool isNotAuxiliaryFound = false;
if (anObjects.size() > 0) {
- QObjectPtrList::const_iterator anIt = anObjects.begin(),
- aLast = anObjects.end();
+ QObjectPtrList::const_iterator anIt = anObjects.begin();
+
+ QObjectPtrList::const_iterator aLast = anObjects.end();
for (; anIt != aLast && !isNotAuxiliaryFound; anIt++) {
FeaturePtr aFeature = ModelAPI_Feature::feature(*anIt);
if ((aFeature.get() != nullptr) &&
for (aIt = aResults.begin(); aIt != aResults.end(); ++aIt) {
anObjects.append(*aIt);
}
- QObjectPtrList::const_iterator anIt = anObjects.begin(),
- aLast = anObjects.end();
+ QObjectPtrList::const_iterator anIt = anObjects.begin();
+
+ QObjectPtrList::const_iterator aLast = anObjects.end();
for (; anIt != aLast; anIt++)
aWorkshop->deactivateActiveObject(*anIt, false);
if (anObjects.size() > 0) {
}
QMap<PartSet_Tools::ConstraintVisibleState, bool>::const_iterator
- anIt = myHasConstraintShown.begin(),
+
+ anIt = myHasConstraintShown.begin();
+
+ QMap<PartSet_Tools::ConstraintVisibleState, bool>::const_iterator
+
aLast = myHasConstraintShown.end();
for (; anIt != aLast; anIt++) {
mySketchMgr->updateBySketchParameters(anIt.key(), anIt.value());
bool aCanActivate = ModuleBase_IModule::canActivateSelection(theObject);
ModuleBase_Operation *anOperation = myWorkshop->currentOperation();
- bool isSketchOp = PartSet_SketcherMgr::isSketchOperation(anOperation),
- isNestedOp = sketchMgr()->isNestedSketchOperation(anOperation);
+ bool isSketchOp = PartSet_SketcherMgr::isSketchOperation(anOperation);
+
+ bool isNestedOp = sketchMgr()->isNestedSketchOperation(anOperation);
if (isSketchOp || isNestedOp) {
// in active sketch operation it is possible to activate operation object in
// selection in the edit operation, e.g. points of the line can be moved
// SessionPtr aMgr = ModelAPI_Session::get();
// 1. check whether the delete should be processed in the module
ModuleBase_Operation *anOperation = myWorkshop->currentOperation();
- bool isSketchOp = PartSet_SketcherMgr::isSketchOperation(anOperation),
- isNestedOp = sketchMgr()->isNestedSketchOperation(anOperation);
+ bool isSketchOp = PartSet_SketcherMgr::isSketchOperation(anOperation);
+
+ bool isNestedOp = sketchMgr()->isNestedSketchOperation(anOperation);
if (isSketchOp || isNestedOp) {
isProcessed = true;
// 2. find selected presentations
// avoid delete of the objects, which are not belong to the current sketch
// in order to do not delete results of other sketches
QObjectPtrList aSketchObjects;
- QObjectPtrList::const_iterator anIt = aSelectedObj.begin(),
- aLast = aSelectedObj.end();
+ QObjectPtrList::const_iterator anIt = aSelectedObj.begin();
+
+ QObjectPtrList::const_iterator aLast = aSelectedObj.end();
for (; anIt != aLast; anIt++) {
ObjectPtr anObject = *anIt;
if (mySketchMgr->isObjectOfSketch(anObject)) {
}
//******************************************************
-void PartSet_Module::onBeforeObjectErase(ObjectPtr theObject,
- AISObjectPtr theAIS) {
+void PartSet_Module::onBeforeObjectErase(ObjectPtr /*theObject*/,
+ AISObjectPtr /*theAIS*/) {
// this is obsolete
// it should be recomputed in order to disappear in the viewer if the
// corresponded object is erased
if (!anImageAttr.get() || !anImageAttr->hasTexture())
return;
- int aWidth, aHeight;
+ int aWidth;
+
+ int aHeight;
std::string aFormat;
std::list<unsigned char> aByteList;
anImageAttr->texture(aWidth, aHeight, aByteList, aFormat);
/// Processing the mouse move event in the viewer
/// \param theWindow a view window
/// \param theEvent a mouse event
- PARTSET_EXPORT virtual void mouseMoved(ModuleBase_IViewWindow *theWindow,
- QMouseEvent *theEvent) {}
+ PARTSET_EXPORT virtual void mouseMoved(ModuleBase_IViewWindow * /*theWindow*/,
+ QMouseEvent * /*theEvent*/) {}
/// Processing the mouse press event in the viewer
/// \param theWindow a view window
/// \param theEvent a mouse event
- PARTSET_EXPORT virtual void mousePressed(ModuleBase_IViewWindow *theWindow,
- QMouseEvent *theEvent) {}
+ PARTSET_EXPORT virtual void
+ mousePressed(ModuleBase_IViewWindow * /*theWindow*/,
+ QMouseEvent * /*theEvent*/) {}
/// Processing the mouse release event in the viewer
/// \param theWindow a view window
/// \param theEvent a mouse event
- PARTSET_EXPORT virtual void mouseReleased(ModuleBase_IViewWindow *theWindow,
- QMouseEvent *theEvent) {}
+ PARTSET_EXPORT virtual void
+ mouseReleased(ModuleBase_IViewWindow * /*theWindow*/,
+ QMouseEvent * /*theEvent*/) {}
/// Processing the mouse double click event in the viewer
/// \param theWindow a view window
/// \param theEvent a mouse event
PARTSET_EXPORT virtual void
- mouseDoubleClick(ModuleBase_IViewWindow *theWindow, QMouseEvent *theEvent) {}
+ mouseDoubleClick(ModuleBase_IViewWindow * /*theWindow*/,
+ QMouseEvent * /*theEvent*/) {}
/// Fill preselection used in mouseReleased
- virtual void
- setPreSelection(const std::shared_ptr<ModuleBase_ViewerPrs> &thePreSelected,
- ModuleBase_IViewWindow *theWnd, QMouseEvent *theEvent) {}
+ virtual void setPreSelection(
+ const std::shared_ptr<ModuleBase_ViewerPrs> & /*thePreSelected*/,
+ ModuleBase_IViewWindow * /*theWnd*/, QMouseEvent * /*theEvent*/) {}
};
#endif
}
void PartSet_OperationPrs::ComputeSelection(const Handle(SelectMgr_Selection) &
- aSelection,
- const Standard_Integer aMode) {
+ /*aSelection*/,
+ const Standard_Integer /*aMode*/) {
// the presentation is not used in the selection
}
QList<GeomShapePtr> aShapes;
std::list<AttributePtr> anAttributes = theFeature->data()->attributes("");
- std::list<AttributePtr>::const_iterator anIt = anAttributes.begin(),
- aLast = anAttributes.end();
+ std::list<AttributePtr>::const_iterator anIt = anAttributes.begin();
+
+ std::list<AttributePtr>::const_iterator aLast = anAttributes.end();
for (; anIt != aLast; anIt++) {
AttributePtr anAttribute = *anIt;
if (!isSelectionAttribute(anAttribute))
std::list<ResultPtr> aResults;
ModelAPI_Tools::allResults(theFeature, aResults);
- std::list<ResultPtr>::const_iterator aRIt = aResults.begin(),
- aRLast = aResults.end();
+ std::list<ResultPtr>::const_iterator aRIt = aResults.begin();
+
+ std::list<ResultPtr>::const_iterator aRLast = aResults.end();
for (; aRIt != aRLast; aRIt++) {
ResultPtr aResult = *aRIt;
if (!aResult->isDisabled()) {
anActiveWidget->getHighlighted(aValues);
QList<GeomShapePtr> aShapes;
- QList<ModuleBase_ViewerPrsPtr>::const_iterator anIIt = aValues.begin(),
- aILast = aValues.end();
+ QList<ModuleBase_ViewerPrsPtr>::const_iterator anIIt = aValues.begin();
+
+ QList<ModuleBase_ViewerPrsPtr>::const_iterator aILast = aValues.end();
for (; anIIt != aILast; anIIt++) {
ModuleBase_ViewerPrsPtr aPrs = *anIIt;
ObjectPtr anObject = aPrs->object();
// create presentations on the base of the shapes
QMap<ObjectPtr, QList<GeomShapePtr>>::const_iterator
- anIt = theFeatureShapes.begin(),
+
+ anIt = theFeatureShapes.begin();
+
+ QMap<ObjectPtr, QList<GeomShapePtr>>::const_iterator
+
aLast = theFeatureShapes.end();
for (; anIt != aLast; anIt++) {
ObjectPtr anObject = anIt.key();
QList<GeomShapePtr> aShapes = anIt.value();
- QList<GeomShapePtr>::const_iterator aShIt = aShapes.begin(),
- aShLast = aShapes.end();
+ QList<GeomShapePtr>::const_iterator aShIt = aShapes.begin();
+
+ QList<GeomShapePtr>::const_iterator aShLast = aShapes.end();
for (; aShIt != aShLast; aShIt++) {
GeomShapePtr aGeomShape = *aShIt;
// the shape should not be checked here on empty value because it should
// set error state for new objects and append them in the internal map of
// objects
- auto anIt = theConflictingObjects.begin(),
- aLast = theConflictingObjects.end();
+ auto anIt = theConflictingObjects.begin();
+
+ auto aLast = theConflictingObjects.end();
int aCountOfSimilarConstraints = 0;
for (; anIt != aLast; anIt++) {
const std::set<ObjectPtr> &theConflictingObjects) {
std::set<ObjectPtr> aModifiedObjects;
// erase error state of absent current objects in the parameter list
- std::set<ObjectPtr>::const_iterator anIt, aLast;
+ std::set<ObjectPtr>::const_iterator anIt;
+
+ std::set<ObjectPtr>::const_iterator aLast;
for (anIt = theConflictingObjects.begin(),
aLast = theConflictingObjects.end();
anIt != aLast; anIt++) {
static Events_ID EVENT_REDISP = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
static const ModelAPI_EventCreator *aECreator = ModelAPI_EventCreator::get();
- auto anIt = theObjects.begin(), aLast = theObjects.end();
+ auto anIt = theObjects.begin();
+
+ auto aLast = theObjects.end();
for (; anIt != aLast; anIt++) {
ObjectPtr aObj = *anIt;
aECreator->sendUpdated(aObj, EVENT_DISP);
std::shared_ptr<GeomAPI_Dir> aXZDir(new GeomAPI_Dir(0, -1, 0));
std::shared_ptr<GeomAPI_Dir> aXYDir(new GeomAPI_Dir(0, 0, 1));
- std::vector<int> aYZRGB(3, 0), aXZRGB(3, 0), aXYRGB(3, 0);
+ std::vector<int> aYZRGB(3, 0);
+
+ std::vector<int> aXZRGB(3, 0);
+
+ std::vector<int> aXYRGB(3, 0);
#ifdef SET_PLANES_COLOR_IN_PREFERENCES
aYZRGB = Config_PropManager::color("Visualization", "yz_plane_color");
aXZRGB = Config_PropManager::color("Visualization", "xz_plane_color");
std::shared_ptr<GeomAPI_Face> aFace(new GeomAPI_Face(myShape));
std::shared_ptr<GeomAPI_Pln> aPlane = aFace->getPlane();
if (aPlane.get()) {
- double anA, aB, aC, aD;
+ double anA;
+
+ double aB;
+
+ double aC;
+
+ double aD;
aPlane->coefficients(anA, aB, aC, aD);
std::shared_ptr<GeomAPI_Dir> aNormDir(new GeomAPI_Dir(anA, aB, aC));
std::shared_ptr<GeomAPI_XYZ> aCoords = aNormDir->xyz();
if (aBox.IsVoid())
return false;
- double aXmin, aXmax, anYmin, anYmax, aZmin, aZmax;
+ double aXmin;
+
+ double aXmax;
+
+ double anYmin;
+
+ double anYmax;
+
+ double aZmin;
+
+ double aZmax;
aBox.Get(aXmin, anYmin, aZmin, aXmax, anYmax, aZmax);
theSizeOfView = maximumSize(aXmin, anYmin, aZmin, aXmax, anYmax, aZmax);
BRep_Builder aBuilder;
// TopoDS_Compound aComp;
aBuilder.MakeCompound(theAuxiliaryCompound);
- std::list<ResultPtr>::const_iterator anIt = anAuxiliaryResults.begin(),
- aLast = anAuxiliaryResults.end();
+ std::list<ResultPtr>::const_iterator anIt = anAuxiliaryResults.begin();
+
+ std::list<ResultPtr>::const_iterator aLast = anAuxiliaryResults.end();
for (; anIt != aLast; anIt++) {
ResultPtr aResult = *anIt;
if (aResult.get()) {
static Events_ID aMoveEvent = Events_Loop::eventByName(EVENT_OBJECT_MOVED);
// static Events_ID aUpdateEvent =
// Events_Loop::eventByName(EVENT_OBJECT_UPDATED);
- FeatureToSelectionMap::const_iterator anIt = myCurrentSelection.begin(),
- aLast = myCurrentSelection.end();
+ FeatureToSelectionMap::const_iterator anIt = myCurrentSelection.begin();
+
+ FeatureToSelectionMap::const_iterator aLast = myCurrentSelection.end();
// 4. the features and attributes modification(move)
bool isModified = false;
for (; anIt != aLast; anIt++) {
// Process selection by attribute: the priority to the attribute
if (!anAttributes.empty()) {
std::map<AttributePtr, int>::const_iterator anAttIt =
- anAttributes.begin(),
- anAttLast =
- anAttributes.end();
+
+ anAttributes.begin();
+
+ std::map<AttributePtr, int>::const_iterator anAttLast =
+
+ anAttributes.end();
for (; anAttIt != anAttLast; anAttIt++) {
AttributePtr anAttr = anAttIt->first;
if (anAttr.get() == nullptr)
QMouseEvent *theEvent, Point &thePoint) {
Handle(V3d_View) aView = theWnd->v3dView();
gp_Pnt aPoint = PartSet_Tools::convertClickToPoint(theEvent->pos(), aView);
- double aX, anY;
+ double aX;
+
+ double anY;
PartSet_Tools::convertTo2D(aPoint, myCurrentSketch, aView, aX, anY);
thePoint.setValue(aX, anY);
}
std::map<FeaturePtr, std::set<FeaturePtr>> aReferences;
ModelAPI_Tools::findAllReferences(anInvalidFeatures, aReferences, false);
- auto anIt = anInvalidFeatures.begin(), aLast = anInvalidFeatures.end();
+ auto anIt = anInvalidFeatures.begin();
+
+ auto aLast = anInvalidFeatures.end();
// separate features to references to parameter features and references to
// others
QStringList anInvalidFeatureNames;
if (theObject == aFeature)
isObjectFound = true;
else {
- std::list<ResultPtr>::const_iterator anIt = aResults.begin(),
- aLast = aResults.end();
+ std::list<ResultPtr>::const_iterator anIt = aResults.begin();
+
+ std::list<ResultPtr>::const_iterator aLast = aResults.end();
for (; anIt != aLast && !isObjectFound; anIt++) {
isObjectFound = *anIt == theObject;
}
std::list<AttributePtr> aRefAttrs =
aFeature->data()->attributes(ModelAPI_AttributeRefAttr::typeId());
- std::list<AttributePtr>::const_iterator anIt = aRefAttrs.begin(),
- aLast = aRefAttrs.end();
+ std::list<AttributePtr>::const_iterator anIt = aRefAttrs.begin();
+
+ std::list<AttributePtr>::const_iterator aLast = aRefAttrs.end();
for (; anIt != aLast && anAllRefAttrInitialized; anIt++) {
anAllRefAttrInitialized = (*anIt)->isInitialized();
}
auto *anEditor = dynamic_cast<PartSet_WidgetEditor *>(aWgt);
if (anEditor) {
- int aX = 0, anY = 0;
+ int aX = 0;
+
+ int anY = 0;
XGUI_Workshop *aWorkshop = XGUI_Tools::workshop(theWorkshop);
XGUI_Displayer *aDisplayer = aWorkshop->displayer();
ModuleBase_IViewer *aViewer = aWorkshop->viewer();
Handle(V3d_View) aView = aViewer->activeView();
- int aCX, aCY;
+ int aCX;
+
+ int aCY;
aView->Convert(aPosition.X(), aPosition.Y(), aPosition.Z(), aCX,
aCY);
// the features moving
theCurrentSelection.clear();
- QList<ModuleBase_ViewerPrsPtr>::const_iterator anIt = aStoredPrs.begin(),
- aLast = aStoredPrs.end();
+ QList<ModuleBase_ViewerPrsPtr>::const_iterator anIt = aStoredPrs.begin();
+
+ QList<ModuleBase_ViewerPrsPtr>::const_iterator aLast = aStoredPrs.end();
CompositeFeaturePtr aSketch = activeSketch();
for (; anIt != aLast; anIt++) {
// %1").arg(theCurrentSelection.size()).toStdString().c_str());
ModuleBase_IWorkshop *aWorkshop = myModule->workshop();
auto *aConnector = dynamic_cast<XGUI_ModuleConnector *>(aWorkshop);
- FeatureToSelectionMap::const_iterator aSIt = theCurrentSelection.begin(),
- aSLast = theCurrentSelection.end();
+ FeatureToSelectionMap::const_iterator aSIt = theCurrentSelection.begin();
+
+ FeatureToSelectionMap::const_iterator aSLast = theCurrentSelection.end();
SelectMgr_IndexedMapOfOwner anOwnersToSelect;
anOwnersToSelect.Clear();
for (; aSIt != aSLast; aSIt++) {
Bnd_Box aBndBox;
int aNumberOfSubs = aSketch->numberOfSubs();
- double aXmin, aYmin, aZmin, aXmax, aYmax, aZmax;
+ double aXmin;
+
+ double aYmin;
+
+ double aZmin;
+
+ double aXmax;
+
+ double aYmax;
+
+ double aZmax;
for (int i = 0; i < aNumberOfSubs; i++) {
FeaturePtr aFeature = aSketch->subFeature(i);
if (aDisplayer->isVisible(aFeature)) {
myWorkshop->currentOperation()->propertyPanel();
FeaturePtr aCurrentFeature = aFOperation->feature();
- bool isLineFeature = false, isReentrantArcFeature = false;
+ bool isLineFeature = false;
+
+ bool isReentrantArcFeature = false;
std::string anAttributeOnStart;
if (aCurrentFeature->getKind() == SketchPlugin_Line::ID()) {
anAttributeOnStart = SketchPlugin_Line::START_ID();
ModuleBase_IPropertyPanel *aPanel = anOperation->propertyPanel();
ModuleBase_ModelWidget *anActiveWidget = aPanel->activeWidget();
const QList<ModuleBase_ModelWidget *> &aWidgets = aPanel->modelWidgets();
- QList<ModuleBase_ModelWidget *>::const_iterator anIt = aWidgets.begin(),
- aLast = aWidgets.end();
+ QList<ModuleBase_ModelWidget *>::const_iterator anIt = aWidgets.begin();
+
+ QList<ModuleBase_ModelWidget *>::const_iterator aLast = aWidgets.end();
bool aFoundWidget = false;
bool aFoundObligatory = false;
for (; anIt != aLast && !aFoundObligatory; anIt++) {
if (theView.IsNull())
return gp_Pnt();
- Standard_Real XAt, YAt, ZAt;
+ Standard_Real XAt;
+
+ Standard_Real YAt;
+
+ Standard_Real ZAt;
theView->At(XAt, YAt, ZAt);
gp_Pnt AtPoint(XAt, YAt, ZAt);
- double aX, aY, aZ;
+ double aX;
+
+ double aY;
+
+ double aZ;
theView->Proj(aX, aY, aZ);
gp_Dir EyeDir(aX, aY, aZ);
EyeDir.Reverse();
gp_Pln PlaneOfTheView = gp_Pln(AtPoint, EyeDir);
- Standard_Real X, Y, Z;
+ Standard_Real X;
+
+ Standard_Real Y;
+
+ Standard_Real Z;
theView->Convert(thePoint.x(), thePoint.y(), X, Y, Z);
gp_Pnt ConvertedPoint(X, Y, Z);
gp_Vec aVec(anOriginPnt, thePoint);
if (!theView.IsNull()) {
- Standard_Real XEye, YEye, ZEye, XAt, YAt, ZAt;
+ Standard_Real XEye;
+
+ Standard_Real YEye;
+
+ Standard_Real ZEye;
+
+ Standard_Real XAt;
+
+ Standard_Real YAt;
+
+ Standard_Real ZAt;
theView->Eye(XEye, YEye, ZEye);
theView->At(XAt, YAt, ZAt);
ModelAPI_Feature::feature(theAttribute->owner());
// 2.1 get visualized results of the feature
const std::list<ResultPtr> &aResList = anAttributeFeature->results();
- auto anIt = aResList.begin(), aLast = aResList.end();
+ auto anIt = aResList.begin();
+
+ auto aLast = aResList.end();
for (; anIt != aLast; anIt++) {
AISObjectPtr aAISObj = aDisplayer->getAISObject(*anIt);
if (aAISObj.get() != nullptr) {
const FeaturePtr &theSketch) {
gp_Pnt aPnt =
PartSet_Tools::convertClickToPoint(theEvent->pos(), theWindow->v3dView());
- double aX, anY;
+ double aX;
+
+ double anY;
Handle(V3d_View) aView = theWindow->v3dView();
PartSet_Tools::convertTo2D(aPnt, theSketch, aView, aX, anY);
if (!aVertex.IsNull()) {
// the case when the point is taken from the existing vertex
gp_Pnt aPoint = BRep_Tool::Pnt(aVertex);
- double aX, aY;
+ double aX;
+
+ double aY;
PartSet_Tools::convertTo2D(aPoint, theSketch, theView, aX, aY);
aPoint2D.reset(new GeomAPI_Pnt2d(aX, aY));
}
anAttiributes.insert(anAttiributes.end(), anArrays.begin(),
anArrays.end());
- std::list<AttributePtr>::const_iterator anIt = anAttiributes.begin(),
- aLast = anAttiributes.end();
+ std::list<AttributePtr>::const_iterator anIt = anAttiributes.begin();
+
+ std::list<AttributePtr>::const_iterator aLast = anAttiributes.end();
double aMinDistance =
1.e-6; // searching for point with minimal distance and < 1.e-6
for (; anIt != aLast && !anAttribute; anIt++) {
std::vector<int> &theColor) {
theColor.clear();
// get default color from the preferences manager for the given result
- std::string aSection, aName, aDefault;
+ std::string aSection;
+
+ std::string aName;
+
+ std::string aDefault;
theObject->colorConfigInfo(aSection, aName, aDefault);
if (!aSection.empty() && !aName.empty()) {
theColor = Config_PropManager::color(aSection, aName);
//////////////////////////////////////////////////////////////////////////////////
void PartSet_ObjectFolderNode::update() {
- int aFirst = -1, aLast = -1;
+ int aFirst = -1;
+
+ int aLast = -1;
PartSet_Tools::getFirstAndLastIndexInFolder(myObject, aFirst, aLast);
if ((aFirst == -1) || (aLast == -1)) {
deleteChildren();
QTreeNodesList
PartSet_ObjectFolderNode::objectCreated(const QObjectPtrList & /*theObjects*/) {
QTreeNodesList aResult;
- int aFirst = -1, aLast = -1;
+ int aFirst = -1;
+
+ int aLast = -1;
PartSet_Tools::getFirstAndLastIndexInFolder(myObject, aFirst, aLast);
if ((aFirst == -1) || (aLast == -1)) {
return aResult;
PartSet_ObjectFolderNode::objectsDeleted(const DocumentPtr & /*theDoc*/,
const QString & /*theGroup*/) {
QTreeNodesList aResult;
- int aFirst = -1, aLast = -1;
+ int aFirst = -1;
+
+ int aLast = -1;
PartSet_Tools::getFirstAndLastIndexInFolder(myObject, aFirst, aLast);
if ((aFirst == -1) || (aLast == -1)) {
return aResult;
if (aShape->shapeType() == GeomAPI_Shape::EDGE) {
const auto &aTDShape = aShape->impl<TopoDS_Shape>();
TopoDS_Edge aEdge = TopoDS::Edge(aTDShape);
- Standard_Real aStart, aEnd;
+ Standard_Real aStart;
+
+ Standard_Real aEnd;
Handle(Geom_Curve) aCurve = BRep_Tool::Curve(aEdge, aStart, aEnd);
GeomAdaptor_Curve aAdaptor(aCurve);
theEdges[(int)aAdaptor.GetType()] += 1;
}
// if there is no coincidence then it is not valid
if (aCoinList.size() > 0) {
- QList<FeaturePtr>::const_iterator anIt = aCoinsideLines.begin(),
- aLast = aCoinsideLines.end();
+ QList<FeaturePtr>::const_iterator anIt = aCoinsideLines.begin();
+
+ QList<FeaturePtr>::const_iterator aLast = aCoinsideLines.end();
bool aValid = false;
for (; anIt != aLast && !aValid; anIt++) {
aValid = *anIt == aOtherFea;
bool aValid = false;
// stores the current values of the widget attribute
- bool isFlushesActived, isAttributeSetInitializedBlocked,
- isAttributeSendUpdatedBlocked;
+ bool isFlushesActived;
+
+ bool isAttributeSetInitializedBlocked;
+
+ bool isAttributeSendUpdatedBlocked;
AttributeRefAttrListPtr aRefAttrList = attributeRefAttrList();
ModuleBase_WidgetValidated::blockFeatureAttribute(
gp_Pnt aPoint =
PartSet_Tools::convertClickToPoint(theEvent->pos(), theWindow->v3dView());
- double aX = 0, aY = 0;
+ double aX = 0;
+
+ double aY = 0;
PartSet_Tools::convertTo2D(aPoint, mySketch, theWindow->v3dView(), aX, aY);
if (myState != ModifiedInViewer)
storeCurentValue();
//********************************************************************
void PartSet_WidgetFeaturePointSelector::setPreSelection(
- const ModuleBase_ViewerPrsPtr &thePreSelected,
- ModuleBase_IViewWindow *theWnd, QMouseEvent *theEvent) {
+ const ModuleBase_ViewerPrsPtr & /*thePreSelected*/,
+ ModuleBase_IViewWindow * /*theWnd*/, QMouseEvent * /*theEvent*/) {
// the method is empty because firstly by starging of the feature there is no
// selection of sub-segments in the viewer, secondly preselection of restart
// operation is processed by special reentrant message sent by the feature
bool aValid = false;
// stores the current values of the widget attribute
- bool isFlushesActived, isAttributeSetInitializedBlocked,
- isAttributeSendUpdatedBlocked;
+ bool isFlushesActived;
+
+ bool isAttributeSetInitializedBlocked;
+
+ bool isAttributeSendUpdatedBlocked;
AttributeRefAttrPtr aRefAttr = attributeRefAttr();
ModuleBase_WidgetValidated::blockFeatureAttribute(
}
}
-void PartSet_WidgetPoint2D::setHighlighted(bool isHighlighted) {}
+void PartSet_WidgetPoint2D::setHighlighted(bool /*isHighlighted*/) {}
void PartSet_WidgetPoint2D::deactivate() {
// the value of the control should be stored to model if it was not
aFirstValue = myPreSelected;
}
- double aX = 0, aY = 0;
+ double aX = 0;
+
+ double aY = 0;
bool aHasPoint = false;
if (aFirstValue.get()) {
GeomShapePtr aShape = aFirstValue->shape();
}
} else {
if (!isFeatureContainsPoint(myFeature, theX, theY)) {
- double aX = 0, aY = 0;
+ double aX = 0;
+
+ double aY = 0;
bool anOrphanPoint = isOrphanPoint(aSelectedFeature, mySketch, aX, aY);
// do not set a coincidence constraint in the attribute if the feature
// contains a point with the same coordinates. It is important for line
gp_Pnt aPoint =
PartSet_Tools::convertClickToPoint(theEvent->pos(), theWindow->v3dView());
- double aX = 0, aY = 0;
+ double aX = 0;
+
+ double aY = 0;
PartSet_Tools::convertTo2D(aPoint, mySketch, theWindow->v3dView(), aX, aY);
if (myState != ModifiedInViewer)
storeCurentValue();
PartSet_Tools::findCoincidences(
aCoincidence, aCoinsideLines, aCoins,
SketchPlugin_ConstraintCoincidence::ENTITY_B(), anIsAttributes);
- QList<FeaturePtr>::const_iterator anIt = aCoinsideLines.begin(),
- aLast = aCoinsideLines.end();
+ QList<FeaturePtr>::const_iterator anIt = aCoinsideLines.begin();
+
+ QList<FeaturePtr>::const_iterator aLast = aCoinsideLines.end();
for (; anIt != aLast && anOrphanPoint; anIt++) {
anOrphanPoint = (*anIt)->getKind() != SketchPlugin_Line::ID();
}
std::list<AttributePtr> anAttributes =
theFeature->data()->attributes(ModelAPI_AttributeRefList::typeId());
- std::list<AttributePtr>::const_iterator anIt = anAttributes.begin(),
- aLast = anAttributes.end();
+ std::list<AttributePtr>::const_iterator anIt = anAttributes.begin();
+
+ std::list<AttributePtr>::const_iterator aLast = anAttributes.end();
for (; anIt != aLast && !aFeaturePoint.get(); anIt++) {
std::shared_ptr<ModelAPI_AttributeRefList> aCurSelList =
std::dynamic_pointer_cast<ModelAPI_AttributeRefList>(*anIt);
std::list<std::shared_ptr<ModelAPI_Attribute>> anAttiributes =
theFeature->data()->attributes(GeomDataAPI_Point2D::typeId());
std::list<std::shared_ptr<ModelAPI_Attribute>>::const_iterator
- anIt = anAttiributes.begin(),
+
+ anIt = anAttiributes.begin();
+
+ std::list<std::shared_ptr<ModelAPI_Attribute>>::const_iterator
+
aLast = anAttiributes.end();
ModelAPI_ValidatorsFactory *aValidators =
ModelAPI_Session::get()->validators();
aData->attribute(SketchPlugin_Sketch::FEATURES_ID()));
std::list<ObjectPtr> aFeatures = aRefList->list();
- std::list<ObjectPtr>::const_iterator anIt = aFeatures.begin(),
- aLast = aFeatures.end();
+ std::list<ObjectPtr>::const_iterator anIt = aFeatures.begin();
+
+ std::list<ObjectPtr>::const_iterator aLast = aFeatures.end();
std::list<std::shared_ptr<ModelAPI_Attribute>> anAttiributes;
std::shared_ptr<GeomDataAPI_Point2D> aFPoint;
bool aDone = false;
if (!startSketchOperation(theValues)) {
myIsCustomAttribute = true;
- QList<ModuleBase_ViewerPrsPtr>::const_iterator anIt = theValues.begin(),
- aLast = theValues.end();
+ QList<ModuleBase_ViewerPrsPtr>::const_iterator anIt = theValues.begin();
+
+ QList<ModuleBase_ViewerPrsPtr>::const_iterator aLast = theValues.end();
bool aProcessed = false;
for (; anIt != aLast; anIt++) {
ModuleBase_ViewerPrsPtr aValue = *anIt;
}
//********************************************************************
-void PartSet_WidgetSketchCreator::updateOnSelectionChanged(const bool theDone) {
-}
+void PartSet_WidgetSketchCreator::updateOnSelectionChanged(
+ const bool /*theDone*/) {}
bool PartSet_WidgetSketchCreator::startSketchOperation(
const QList<ModuleBase_ViewerPrsPtr> &theValues) {
aStates[PartSet_Tools::Expressions] = tr("Show existing expressions");
QMap<PartSet_Tools::ConstraintVisibleState, QString>::const_iterator
- anIt = aStates.begin(),
+
+ anIt = aStates.begin();
+
+ QMap<PartSet_Tools::ConstraintVisibleState, QString>::const_iterator
+
aLast = aStates.end();
for (; anIt != aLast; anIt++) {
auto *aShowConstraints = new QCheckBox(anIt.value(), this);
auto *aSenderCheckBox = qobject_cast<QCheckBox *>(sender());
QMap<PartSet_Tools::ConstraintVisibleState, QCheckBox *>::const_iterator
- anIt = myShowConstraints.begin(),
+
+ anIt = myShowConstraints.begin();
+
+ QMap<PartSet_Tools::ConstraintVisibleState, QCheckBox *>::const_iterator
+
aLast = myShowConstraints.end();
PartSet_Tools::ConstraintVisibleState aState = PartSet_Tools::Geometrical;
// to the method attributes or stored in the widget
std::list<AttributePtr> anAttributes = myFeature->data()->attributes("");
- std::list<AttributePtr>::const_iterator anIt = anAttributes.begin(),
- aLast = anAttributes.end();
+ std::list<AttributePtr>::const_iterator anIt = anAttributes.begin();
+
+ std::list<AttributePtr>::const_iterator aLast = anAttributes.end();
QStringList aValues;
for (; anIt != aLast; anIt++) {
AttributePtr anAttribute = *anIt;
std::shared_ptr<GeomAPI_Pln> thePlane) {
// set plane parameters to feature
std::shared_ptr<ModelAPI_Data> aData = feature()->data();
- double anA, aB, aC, aD;
+ double anA;
+
+ double aB;
+
+ double aC;
+
+ double aD;
thePlane->coefficients(anA, aB, aC, aD);
// calculate attributes of the sketch
/// This method to inform that sub-feature is removed and must be removed from
/// the internal data structures of the owner (the remove from the document
/// will be done outside just after)
- void removeFeature(std::shared_ptr<ModelAPI_Feature> theFeature) override {}
+ void
+ removeFeature(std::shared_ptr<ModelAPI_Feature> /*theFeature*/) override {}
/// Use plugin manager for features creation
PartSetPlugin_Part();
QtxActionToolMgr *aMgr = toolMgr();
QStringList aToolbars = theNewToolbars.keys();
- QIntList aCommands, aOldCmd;
+ QIntList aCommands;
+
+ QIntList aOldCmd;
int aToolbarId;
QAction *aAction;
int aActionId;
QDir aDir(aTmpDir);
QStringList aFiles = aDir.entryList(QDir::Files);
- QStringList::const_iterator anIt = aFiles.begin(), aLast = aFiles.end();
+ QStringList::const_iterator anIt = aFiles.begin();
+
+ QStringList::const_iterator aLast = aFiles.end();
for (; anIt != aLast; anIt++) {
QString aFileName = *anIt;
if (!theShape1.IsNull() && !theShape2.IsNull() &&
theShape1.ShapeType() == theShape2.ShapeType()) {
if (theShape1.ShapeType() == TopAbs_FACE) { // check surfaces
- TopLoc_Location aLoc1, aLoc2;
+ TopLoc_Location aLoc1;
+
+ TopLoc_Location aLoc2;
TopoDS_Face aFace1 = TopoDS::Face(theShape1);
Handle(Geom_Surface) aSurf1 = BRep_Tool::Surface(aFace1, aLoc1);
TopoDS_Face aFace2 = TopoDS::Face(theShape2);
Handle(Geom_Surface) aSurf2 = BRep_Tool::Surface(aFace2, aLoc2);
return aSurf1 == aSurf2 && aLoc1.IsEqual(aLoc2);
} else if (theShape1.ShapeType() == TopAbs_EDGE) { // check curves
- TopLoc_Location aLoc1, aLoc2;
- Standard_Real aFirst, aLast;
+ TopLoc_Location aLoc1;
+
+ TopLoc_Location aLoc2;
+ Standard_Real aFirst;
+
+ Standard_Real aLast;
TopoDS_Edge anEdge1 = TopoDS::Edge(theShape1);
Handle(Geom_Curve) aCurve1 =
BRep_Tool::Curve(anEdge1, aLoc1, aFirst, aLast);
if (aLinePos != std::wstring::npos) {
std::wstring aContextName = aLastLevel.substr(aLinePos + 1);
if (!aContextName.empty()) {
- TDF_Label aThisContext, aValue;
+ TDF_Label aThisContext;
+
+ TDF_Label aValue;
if (theNameGenerator->restoreContext(aContextName, aThisContext,
aValue)) {
if (!aThisContext.IsNull())
myRecomputeWeakIndex = aFoundOldWeak == 0;
continue;
}
- TDF_Label aSubContext, aValue;
+ TDF_Label aSubContext;
+
+ TDF_Label aValue;
if (!theNameGenerator->restoreContext(aSubStr, aSubContext, aValue))
return TDF_Label(); // can not restore
if (aSubContext.IsNull() ||
AttributePtr anAttrB = aRefAttrB->attr();
AttributeIntegerPtr aPoleIndex;
- FeaturePtr aPoint, aLine;
+ FeaturePtr aPoint;
+
+ FeaturePtr aLine;
if (anAttrA &&
anAttrA->attributeType() == GeomDataAPI_Point2DArray::typeId()) {
aPoleIndex = anOwner->integer(
<< ")" << std::endl;
} else {
// check if some B-spline parameters are default and should not be dumped
- bool isDefaultDegree, isDefaultWeights, isDefaultKnotsMults;
+ bool isDefaultDegree;
+
+ bool isDefaultWeights;
+
+ bool isDefaultKnotsMults;
checkDefaultParameters(isDefaultDegree, isDefaultWeights,
isDefaultKnotsMults);
SketchAPI_SketchEntity::dump(theDumper);
// dump control polygon
- std::map<int, FeaturePtr> anAuxPoles, anAuxSegments;
+ std::map<int, FeaturePtr> anAuxPoles;
+
+ std::map<int, FeaturePtr> anAuxSegments;
collectAuxiliaryFeatures(aBase, anAuxPoles, anAuxSegments);
if (!anAuxPoles.empty())
theDumper << "[";
bool isFirst = true;
// dump features and split them to auxiliary and regular
- std::set<int> aRegular, anAuxiliary;
+ std::set<int> aRegular;
+
+ std::set<int> anAuxiliary;
for (const auto &theAuxFeature : theAuxFeatures) {
if (!isFirst)
theDumper << ", ";
weights()->setValue(anIndex, theWeight.value());
// update coordinates of points of control polygon
- std::map<int, FeaturePtr> aPoints, aLines;
+ std::map<int, FeaturePtr> aPoints;
+
+ std::map<int, FeaturePtr> aLines;
collectAuxiliaryFeatures(feature(), aPoints, aLines);
auto aFound = aPoints.find(anIndex);
if (aFound != aPoints.end())
static const std::string THE_ANGLE_SUPPLEMENTARY("Supplementary");
static const std::string THE_ANGLE_BACKWARD("Backward");
- double anAngleDirect, anAngleComplmentary, anAngleBackward;
+ double anAngleDirect;
+
+ double anAngleComplmentary;
+
+ double anAngleBackward;
calculatePossibleValuesOfAngle(theFeature, anAngleDirect, anAngleComplmentary,
anAngleBackward);
anAngle = 360;
} else {
GeomAPI_Circ2d aCircleForArc(aCenterAttr->pnt(), aStartAttr->pnt());
- double aStartParam, anEndParam;
+ double aStartParam;
+
+ double anEndParam;
aCircleForArc.parameter(aStartAttr->pnt(), paramTolerance, aStartParam);
aCircleForArc.parameter(anEndAttr->pnt(), paramTolerance, anEndParam);
anAngle = (anEndParam - aStartParam) / PI * 180.0;
// find internal coincidences applied to the poles with greater indices
std::list<AttributeIntegerPtr> aCoincidentPoleIndex;
- std::map<int, FeaturePtr> aControlPoles, aControlSegments;
+ std::map<int, FeaturePtr> aControlPoles;
+
+ std::map<int, FeaturePtr> aControlSegments;
bool hasAuxSegment = false;
const std::set<AttributePtr> &aRefs = data()->refsToMe();
for (const auto &aRef : aRefs) {
SketcherPrs_Tools::getFeaturePoint(
aData, SketchPlugin_Constraint::ENTITY_B(), aPlane);
- GeomPnt2dPtr aGeomPntA, aGeomPntB;
+ GeomPnt2dPtr aGeomPntA;
+
+ GeomPnt2dPtr aGeomPntB;
GeomLine2dPtr aLine;
if (aPointA.get() && aPointB.get()) { // both points
aGeomPntA = aPointA->pnt();
if (theAttributeId != SketchPlugin_Constraint::FLYOUT_VALUE_PNT())
return false;
- std::shared_ptr<GeomAPI_Pnt> aPoint1, aPoint2;
- std::shared_ptr<GeomDataAPI_Point2D> aStartPoint, anEndPoint;
+ std::shared_ptr<GeomAPI_Pnt> aPoint1;
+
+ std::shared_ptr<GeomAPI_Pnt> aPoint2;
+ std::shared_ptr<GeomDataAPI_Point2D> aStartPoint;
+
+ std::shared_ptr<GeomDataAPI_Point2D> anEndPoint;
if (!getPoints(aPoint1, aPoint2, aStartPoint, anEndPoint))
return false;
bool SketchPlugin_ConstraintLength::computeLenghtValue(double &theValue) {
bool aResult = false;
- std::shared_ptr<GeomAPI_Pnt> aPoint1, aPoint2;
- std::shared_ptr<GeomDataAPI_Point2D> aStartPoint, anEndPoint;
+ std::shared_ptr<GeomAPI_Pnt> aPoint1;
+
+ std::shared_ptr<GeomAPI_Pnt> aPoint2;
+ std::shared_ptr<GeomDataAPI_Point2D> aStartPoint;
+
+ std::shared_ptr<GeomDataAPI_Point2D> anEndPoint;
if (getPoints(aPoint1, aPoint2, aStartPoint, anEndPoint)) {
theValue = aPoint1->distance(aPoint2);
aResult = true;
aMirrorIter = aMirroredList.begin();
int indFirstWrong = 0; // index of element starts difference in the lists
std::set<int> anInvalidInd; // list of indices of removed features
- std::shared_ptr<SketchPlugin_Feature> aFeatureIn, aFeatureOut;
+ std::shared_ptr<SketchPlugin_Feature> aFeatureIn;
+
+ std::shared_ptr<SketchPlugin_Feature> aFeatureOut;
for (; anInitIter != anInitialList.end(); anInitIter++, indFirstWrong++) {
// Add features and store indices of objects to remove
aFeatureIn = std::dynamic_pointer_cast<SketchPlugin_Feature>(*anInitIter);
real(MAJOR_RADIUS_ID())->setValue(anEllipse->majorRadius());
real(MINOR_RADIUS_ID())->setValue(anEllipse->minorRadius());
- double aStartParam, aMidParam, aEndParam;
+ double aStartParam;
+
+ double aMidParam;
+
+ double aEndParam;
anEllipse->parameter(anEdge->firstPoint(), tolerance, aStartParam);
anEllipse->parameter(anEdge->middlePoint(), tolerance, aMidParam);
anEllipse->parameter(anEdge->lastPoint(), tolerance, aEndParam);
GeomPnt2dPtr aFocus2d = aFocusAttr->pnt();
GeomPnt2dPtr aStart2d = aStartPointAttr->pnt();
- double aMajorRadius = 0.0, aMinorRadius = 0.0;
+ double aMajorRadius = 0.0;
+
+ double aMinorRadius = 0.0;
calculateRadii(aCenter2d, aFocus2d, aStart2d, aMajorRadius, aMinorRadius);
if (aMinorRadius < tolerance * aMajorRadius)
return false;
GeomPnt2dPtr anEnd = aEndPointAttr->pnt();
std::shared_ptr<GeomAPI_Pnt2d> aProjection =
anEllipseForArc->project(anEnd);
- double aParamStart = 0.0, aParamEnd = 0.0;
+ double aParamStart = 0.0;
+
+ double aParamEnd = 0.0;
if (aProjection && anEnd->distance(aProjection) <= tolerance &&
anEllipseForArc->parameter(anEnd, paramTolerance, aParamEnd)) {
// do not recalculate REVERSED flag if the arc is not consistent
return false;
Events_InfoMessage anError;
- FeaturePtr anEdge1, anEdge2;
+ FeaturePtr anEdge1;
+
+ FeaturePtr anEdge2;
if (!SketchPlugin_FilletVertexValidator::isValidVertex(aPointRefAttr, anError,
anEdge1, anEdge2)) {
setError(anError.messageString());
// First pair of points relate to first feature, second pair - to second.
std::shared_ptr<GeomAPI_Pnt2d> aStartEndPnt[aNbFeatures * 2];
for (int i = 0; i < aNbFeatures; i++) {
- std::string aStartAttr, aEndAttr;
+ std::string aStartAttr;
+
+ std::string aEndAttr;
if (myBaseFeatures[i]->getKind() == SketchPlugin_Line::ID()) {
aStartAttr = SketchPlugin_Line::START_ID();
aEndAttr = SketchPlugin_Line::END_ID();
anAngle = 360;
} else {
GeomAPI_Circ2d aCircleForArc(myCenter, myStart);
- double aStartParam, anEndParam;
+ double aStartParam;
+
+ double anEndParam;
aCircleForArc.parameter(myStart, paramTolerance, aStartParam);
aCircleForArc.parameter(myEnd, paramTolerance, anEndParam);
anAngle = (anEndParam - aStartParam) / PI * 180.0;
std::shared_ptr<GeomAPI_Pnt2d> aPassed =
theCurrentCircular.project(aPassedAttr->pnt());
- double aEndParam, aPassedParam;
+ double aEndParam;
+
+ double aPassedParam;
theCurrentCircular.parameter(myEnd, paramTolerance, aEndParam);
theCurrentCircular.parameter(aPassed, paramTolerance, aPassedParam);
FeaturePtr SketchPlugin_MacroEllipticArc::createEllipticArcFeature() {
GeomShapePtr anArc = getArcShape();
GeomEllipsePtr anEllipse;
- GeomPointPtr aStartPoint, aEndPoint;
+ GeomPointPtr aStartPoint;
+
+ GeomPointPtr aEndPoint;
if (anArc->isEdge()) {
GeomEdgePtr anArcEdge = anArc->edge();
aStartPoint = anArcEdge->firstPoint();
aSketch->attribute(SketchPlugin_Sketch::NORM_ID()));
GeomDirPtr aNormal(new GeomAPI_Dir(aNDir->x(), aNDir->y(), aNDir->z()));
- GeomPointPtr aStart, anEnd;
+ GeomPointPtr aStart;
+
+ GeomPointPtr anEnd;
if (myStartPnt)
aStart = aSketch->to3D(myStartPnt->x(), myStartPnt->y());
if (myEndPnt)
continue;
// 5.a. End points (if any)
- std::shared_ptr<GeomDataAPI_Point2D> aStartPoint, anEndPoint;
+ std::shared_ptr<GeomDataAPI_Point2D> aStartPoint;
+
+ std::shared_ptr<GeomDataAPI_Point2D> anEndPoint;
SketchPlugin_SegmentationTools::getFeaturePoints(aFeature, aStartPoint,
anEndPoint);
// Empty set means all sketch edges.
if (isInSet || theEdgesSet.empty()) {
// Condition 4: consider only features with two end points
- std::shared_ptr<GeomDataAPI_Point2D> aP1, aP2;
+ std::shared_ptr<GeomDataAPI_Point2D> aP1;
+
+ std::shared_ptr<GeomDataAPI_Point2D> aP2;
SketchPlugin_SegmentationTools::getFeaturePoints(aCoincFeature, aP1,
aP2);
if (aP1 && aP2) {
theProcessedEdgesSet.insert(aNextEdgeFeature);
// 4. Which end of aNextEdgeFeature we need to proceed
- std::shared_ptr<GeomDataAPI_Point2D> aP1, aP2;
+ std::shared_ptr<GeomDataAPI_Point2D> aP1;
+
+ std::shared_ptr<GeomDataAPI_Point2D> aP2;
SketchPlugin_SegmentationTools::getFeaturePoints(aNextEdgeFeature, aP1, aP2);
if (aP2->pnt()->isEqual(theEndPoint->pnt())) {
// reversed
// update lists of base shapes and of offset shapes
int aBaseListSize = aBaseRefList->size();
int anOffsetListSize = anOffsetRefList->size();
- int aBaseListIndex = 0, anOffsetListIndex = 0;
+ int aBaseListIndex = 0;
+
+ int anOffsetListIndex = 0;
std::list<int> anOffsetBaseBackRefs;
std::set<GeomShapePtr, GeomAPI_Shape::ComparatorWithOri> aProcessedOffsets;
for (auto &aSIt : aSelectedList) {
std::shared_ptr<GeomAPI_Edge> aResEdge(new GeomAPI_Edge(theShape));
- std::shared_ptr<GeomAPI_Pnt2d> aFP, aLP;
+ std::shared_ptr<GeomAPI_Pnt2d> aFP;
+
+ std::shared_ptr<GeomAPI_Pnt2d> aLP;
std::shared_ptr<GeomAPI_Pnt> aFP3d = aResEdge->firstPoint();
std::shared_ptr<GeomAPI_Pnt> aLP3d = aResEdge->lastPoint();
if (aFP3d && aLP3d) {
aProcessedEdgesSet.insert(aFeature);
// End points (if any)
- std::shared_ptr<GeomDataAPI_Point2D> aStartPoint, anEndPoint;
+ std::shared_ptr<GeomDataAPI_Point2D> aStartPoint;
+
+ std::shared_ptr<GeomDataAPI_Point2D> anEndPoint;
SketchPlugin_SegmentationTools::getFeaturePoints(aFeature, aStartPoint,
anEndPoint);
anIt->second.end());
GeomEdgePtr anEdge1(new GeomAPI_Edge(anEdges.front()));
GeomEdgePtr anEdge2(new GeomAPI_Edge(anEdges.back()));
- GeomVertexPtr V1, V2;
+ GeomVertexPtr V1;
+
+ GeomVertexPtr V2;
anEdge1->vertices(V1, V2);
if (V1->isEqual(aFailedVertex))
V1 = V2;
}
bool SketchPlugin_OverConstraintsResolver::checkHorizontalOrVerticalConflict() {
- auto anIt = myConstraints.begin(), aLast = myConstraints.end();
+ auto anIt = myConstraints.begin();
+
+ auto aLast = myConstraints.end();
bool isHVConstraint = false;
FeaturePtr aFeature;
for (; anIt != aLast; anIt++) {
bool SketchPlugin_OverConstraintsResolver::checkArcsAboutTangentialConflict() {
bool isConflictsFound = false;
- auto anIt = myConstraints.begin(), aLast = myConstraints.end();
+ auto anIt = myConstraints.begin();
+
+ auto aLast = myConstraints.end();
for (; anIt != aLast; anIt++) {
ObjectPtr anObject = *anIt;
ConstraintPtr aConstain =
if (aFeatures.empty()) // actually, this must be avoided by the validators
return;
- std::list<ObjectPtr>::const_iterator anIt = aFeatures.begin(),
- aLast = aFeatures.end();
+ std::list<ObjectPtr>::const_iterator anIt = aFeatures.begin();
+
+ std::list<ObjectPtr>::const_iterator aLast = aFeatures.end();
std::shared_ptr<SketchPlugin_Feature> aFeature;
std::list<std::shared_ptr<GeomAPI_Shape>> aFeaturesPreview;
for (; anIt != aLast; anIt++) {
if (aFace.get()) {
std::shared_ptr<GeomAPI_Pln> aPlane = aFace->getPlane();
if (aPlane.get()) {
- double anA, aB, aC, aD;
+ double anA;
+
+ double aB;
+
+ double aC;
+
+ double aD;
aPlane->coefficients(anA, aB, aC, aD);
// calculate attributes of the sketch
GeomLinePtr anAxisLine = anAxisEdge->line();
GeomDirPtr anAxisDir = anAxisLine->direction();
- double aFirstParam, aLastParam;
+ double aFirstParam;
+
+ double aLastParam;
anAxisEdge->getRange(aFirstParam, aLastParam);
if (theOldPlane->dirX()->isParallel(anAxisDir))
// Find feature constraints
FeaturePtr aBaseFeature = ModelAPI_Feature::feature(aBaseObject);
ResultPtr aBaseFeatureResult = aBaseFeature->lastResult();
- std::set<FeaturePtr> aFeaturesToDelete, aFeaturesToUpdate;
+ std::set<FeaturePtr> aFeaturesToDelete;
+
+ std::set<FeaturePtr> aFeaturesToUpdate;
// std::map<FeaturePtr, IdToPointPair> aTangentFeatures;
std::map<FeaturePtr, IdToPointPair> aCoincidenceToFeature;
keepCurrentFeature();
std::string aFeatureKind = aBaseFeature->getKind();
- FeaturePtr aSplitFeature, anAfterFeature;
+ FeaturePtr aSplitFeature;
+
+ FeaturePtr anAfterFeature;
std::set<AttributePoint2DPtr> aFurtherCoincidences;
std::set<FeaturePtr> aCreatedFeatures;
std::set<std::pair<AttributePtr, AttributePtr>> aModifiedAttributes;
- FeaturePtr aReplacingFeature, aNewFeature;
+ FeaturePtr aReplacingFeature;
+
+ FeaturePtr aNewFeature;
if (aFeatureKind == SketchPlugin_Line::ID())
aNewFeature =
splitLine(aSplitFeature, aBaseFeature, anAfterFeature,
// we should build coincidence constraints to end of the split feature
std::set<std::shared_ptr<GeomDataAPI_Point2D>> aNewCoincidencesToSplitFeature;
- AttributePoint2DPtr aStartPointAttr, anEndPointAttr;
+ AttributePoint2DPtr aStartPointAttr;
+
+ AttributePoint2DPtr anEndPointAttr;
SketchPlugin_SegmentationTools::getFeaturePoints(
theSplitFeature, aStartPointAttr, anEndPointAttr);
if (theFurtherCoincidences.find(aStartPointAttr) ==
theFurtherCoincidences.end())
aNewCoincidencesToSplitFeature.insert(anEndPointAttr);
- auto aCIt = theCoincidenceToFeature.begin(),
- aCLast = theCoincidenceToFeature.end();
+ auto aCIt = theCoincidenceToFeature.begin();
+
+ auto aCLast = theCoincidenceToFeature.end();
#ifdef DEBUG_SPLIT
std::cout << std::endl;
std::cout << "Coincidences to feature(modified):" << std::endl;
: SketchPlugin_Constraint::ENTITY_A();
AttributePoint2DPtr aCoincPoint = aCIt->second.second;
- auto aFCIt = theFurtherCoincidences.begin(),
- aFCLast = theFurtherCoincidences.end();
+ auto aFCIt = theFurtherCoincidences.begin();
+
+ auto aFCLast = theFurtherCoincidences.end();
std::shared_ptr<GeomAPI_Pnt2d> aCoincPnt = aCoincPoint->pnt();
AttributePoint2DPtr aFeaturePointAttribute;
for (; aFCIt != aFCLast && !aFeaturePointAttribute.get(); aFCIt++) {
aCoincFeature->refattr(aSecondAttribute)->attr());
theFeaturesToDelete.insert(aCIt->first);
// create new coincidences to split feature points
- auto aSFIt = aNewCoincidencesToSplitFeature.begin(),
- aSFLast = aNewCoincidencesToSplitFeature.end();
+ auto aSFIt = aNewCoincidencesToSplitFeature.begin();
+
+ auto aSFLast = aNewCoincidencesToSplitFeature.end();
for (; aSFIt != aSFLast; aSFIt++) {
AttributePoint2DPtr aSFAttribute = *aSFIt;
if (aCoincPnt->isEqual(aSFAttribute->pnt())) {
void SketchPlugin_Split::updateRefFeatureConstraints(
const ResultPtr &theFeatureBaseResult,
const std::list<AttributePtr> &theRefsToFeature) {
- auto anIt = theRefsToFeature.begin(), aLast = theRefsToFeature.end();
+ auto anIt = theRefsToFeature.begin();
+
+ auto aLast = theRefsToFeature.end();
for (; anIt != aLast; anIt++) {
AttributeRefAttrPtr aRefAttr =
std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(*anIt);
AttributePoint2DPtr aFirstPointAttrOfSplit = getPointAttribute(true);
AttributePoint2DPtr aSecondPointAttrOfSplit = getPointAttribute(false);
- AttributePoint2DPtr aStartPointAttrOfBase, anEndPointAttrOfBase;
+ AttributePoint2DPtr aStartPointAttrOfBase;
+
+ AttributePoint2DPtr anEndPointAttrOfBase;
SketchPlugin_SegmentationTools::getFeaturePoints(
aBaseFeature, aStartPointAttrOfBase, anEndPointAttrOfBase);
AttributePoint2DPtr aFirstPointAttrOfSplit = getPointAttribute(true);
AttributePoint2DPtr aSecondPointAttrOfSplit = getPointAttribute(false);
- AttributePoint2DPtr aStartPointAttrOfBase, anEndPointAttrOfBase;
+ AttributePoint2DPtr aStartPointAttrOfBase;
+
+ AttributePoint2DPtr anEndPointAttrOfBase;
SketchPlugin_SegmentationTools::getFeaturePoints(
aBaseFeature, aStartPointAttrOfBase, anEndPointAttrOfBase);
if (!aStartPointAttrOfBase.get() && !anEndPointAttrOfBase.get()) {
AttributePoint2DPtr aFirstPointAttrOfSplit = getPointAttribute(true);
AttributePoint2DPtr aSecondPointAttrOfSplit = getPointAttribute(false);
- AttributePoint2DPtr aStartPointAttrOfBase, anEndPointAttrOfBase;
+ AttributePoint2DPtr aStartPointAttrOfBase;
+
+ AttributePoint2DPtr anEndPointAttrOfBase;
SketchPlugin_SegmentationTools::getFeaturePoints(
aBaseFeature, aStartPointAttrOfBase, anEndPointAttrOfBase);
if (!aStartPointAttrOfBase.get() && !anEndPointAttrOfBase.get()) {
std::shared_ptr<GeomAPI_Pnt> aFirstPnt = anEdge->firstPoint();
std::shared_ptr<GeomAPI_Pnt> aLastPnt = anEdge->lastPoint();
- std::shared_ptr<GeomDataAPI_Point2D> aFirstPointAttr, aLastPointAttr;
+ std::shared_ptr<GeomDataAPI_Point2D> aFirstPointAttr;
+
+ std::shared_ptr<GeomDataAPI_Point2D> aLastPointAttr;
// find the points in feature attributes
FeaturePtr aBaseFeature = ModelAPI_Feature::feature(aBaseObject);
std::list<AttributePtr> a2DPointAttributes =
aBaseFeature->data()->attributes(GeomDataAPI_Point2D::typeId());
- std::list<AttributePtr>::const_iterator anIt = a2DPointAttributes.begin(),
- aLast = a2DPointAttributes.end();
+ std::list<AttributePtr>::const_iterator anIt = a2DPointAttributes.begin();
+
+ std::list<AttributePtr>::const_iterator aLast = a2DPointAttributes.end();
for (; anIt != aLast; anIt++) {
std::shared_ptr<GeomDataAPI_Point2D> anAttributePoint =
std::dynamic_pointer_cast<GeomDataAPI_Point2D>(*anIt);
// find the points in coincident features
const GeomAlgoAPI_ShapeTools::PointToRefsMap &aRefAttributes =
myCashedReferences.at(aBaseObject);
- auto aRIt = aRefAttributes.begin(), aRLast = aRefAttributes.end();
+ auto aRIt = aRefAttributes.begin();
+
+ auto aRLast = aRefAttributes.end();
for (; aRIt != aRLast; aRIt++) {
const std::list<AttributePoint2DPtr> &anAttributes = aRIt->second.first;
GeomPointPtr aPoint = aRIt->first;
const FeaturePtr &theFeature, AttributePoint2DPtr &theStartPointAttr,
AttributePoint2DPtr &theEndPointAttr) {
std::string aFeatureKind = theFeature->getKind();
- std::string aStartAttributeName, anEndAttributeName;
+ std::string aStartAttributeName;
+
+ std::string anEndAttributeName;
if (aFeatureKind == SketchPlugin_Line::ID()) {
aStartAttributeName = SketchPlugin_Line::START_ID();
anEndAttributeName = SketchPlugin_Line::END_ID();
theFeature->data()->attributes(GeomDataAPI_Point2D::typeId());
std::set<AttributePtr> aPointAttributesSet;
- std::list<AttributePtr>::const_iterator aPIt = aPointAttributes.begin(),
- aPLast = aPointAttributes.end();
+ std::list<AttributePtr>::const_iterator aPIt = aPointAttributes.begin();
+
+ std::list<AttributePtr>::const_iterator aPLast = aPointAttributes.end();
for (; aPIt != aPLast; aPIt++)
aPointAttributesSet.insert(*aPIt);
std::shared_ptr<GeomAPI_Pnt> aStartPoint;
std::shared_ptr<GeomAPI_Pnt> aSecondPoint;
const std::set<GeomShapePtr> &aShapes = theCashedShapes[aBaseObject];
- auto anIt = aShapes.begin(), aLast = aShapes.end();
+ auto anIt = aShapes.begin();
+
+ auto aLast = aShapes.end();
for (; anIt != aLast; anIt++) {
GeomShapePtr aCurrentShape = *anIt;
std::shared_ptr<GeomAPI_Pnt> aProjectedPoint;
std::cout << "updateRefAttConstraints" << std::endl;
#endif
- auto anIt = theModifiedAttributes.begin(),
- aLast = theModifiedAttributes.end();
+ auto anIt = theModifiedAttributes.begin();
+
+ auto aLast = theModifiedAttributes.end();
for (; anIt != aLast; anIt++) {
AttributePtr anAttribute = anIt->first;
AttributePtr aNewAttribute = anIt->second;
continue;
std::list<AttributePtr> aRefAttributes =
theBaseRefAttributes.at(anAttribute);
- std::list<AttributePtr>::const_iterator aRefIt = aRefAttributes.begin(),
- aRLast = aRefAttributes.end();
+ std::list<AttributePtr>::const_iterator aRefIt = aRefAttributes.begin();
+
+ std::list<AttributePtr>::const_iterator aRLast = aRefAttributes.end();
for (; aRefIt != aRLast; aRefIt++) {
AttributeRefAttrPtr aRefAttr =
void SketchPlugin_SegmentationTools::updateFeaturesAfterOperation(
const std::set<FeaturePtr> &theFeaturesToUpdate) {
- auto anIt = theFeaturesToUpdate.begin(), aLast = theFeaturesToUpdate.end();
+ auto anIt = theFeaturesToUpdate.begin();
+
+ auto aLast = theFeaturesToUpdate.end();
for (; anIt != aLast; anIt++) {
FeaturePtr aRefFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(*anIt);
std::string aRefFeatureKind = aRefFeature->getKind();
const std::set<GeomShapePtr> &aShapes = myCashedShapes[aBaseObject];
if (!aShapes.empty()) {
- auto anIt = aShapes.begin(), aLast = aShapes.end();
+ auto anIt = aShapes.begin();
+
+ auto aLast = aShapes.end();
for (; anIt != aLast; anIt++) {
GeomShapePtr aBaseShape = *anIt;
std::shared_ptr<GeomAPI_Pnt> aProjectedPoint;
bool anIsEqualPreviewAndSelected = aPreviewObject == aBaseObject;
/// points of trim
- std::shared_ptr<GeomAPI_Pnt> aStartShapePoint, aLastShapePoint;
+ std::shared_ptr<GeomAPI_Pnt> aStartShapePoint;
+
+ std::shared_ptr<GeomAPI_Pnt> aLastShapePoint;
#ifdef DEBUG_TRIM
std::cout << " Base Feature: " << aBaseFeature->data()->name() << std::endl;
#endif
convertPoint(aLastShapePoint);
/// find features that should be deleted (e.g. Middle Point) or updated (e.g.
/// Length)
- std::set<FeaturePtr> aFeaturesToDelete, aFeaturesToUpdate;
+ std::set<FeaturePtr> aFeaturesToDelete;
+
+ std::set<FeaturePtr> aFeaturesToUpdate;
getConstraints(aFeaturesToDelete, aFeaturesToUpdate);
// find references(attributes and features) to the base feature
std::map<AttributePtr, std::list<AttributePtr>> aBaseRefAttributes;
std::set<AttributePoint2DPtr> aFurtherCoincidences;
std::set<std::pair<AttributePtr, AttributePtr>> aModifiedAttributes;
const std::string &aKind = aBaseFeature->getKind();
- FeaturePtr aReplacingFeature, aNewFeature;
+ FeaturePtr aReplacingFeature;
+
+ FeaturePtr aNewFeature;
if (aKind == SketchPlugin_Circle::ID() ||
aKind == SketchPlugin_Ellipse::ID()) {
aReplacingFeature = trimClosed(aStartShapePoint2d, aLastShapePoint2d,
return false;
std::shared_ptr<GeomAPI_Pnt2d> aRefPnt2d = aRefPointAttr->pnt();
- auto anIt = theFurtherCoincidences.begin(),
- aLast = theFurtherCoincidences.end();
+ auto anIt = theFurtherCoincidences.begin();
+
+ auto aLast = theFurtherCoincidences.end();
bool aFoundPoint = false;
for (; anIt != aLast && !aFoundPoint; anIt++) {
AttributePoint2DPtr aPointAttribute = (*anIt);
std::list<AttributePtr> aRefAttributes =
theBaseRefAttributes.at(theAttribute);
- std::list<AttributePtr>::const_iterator aRefIt = aRefAttributes.begin(),
- aRLast = aRefAttributes.end();
+ std::list<AttributePtr>::const_iterator aRefIt = aRefAttributes.begin();
+
+ std::list<AttributePtr>::const_iterator aRLast = aRefAttributes.end();
std::set<FeaturePtr> aFeaturesToDelete;
for (; aRefIt != aRLast; aRefIt++) {
FeaturePtr aBaseFeature = ModelAPI_Feature::feature(aBaseObjectAttr->value());
/// points of trim
- AttributePoint2DPtr aStartPointAttrOfBase, anEndPointAttrOfBase;
+ AttributePoint2DPtr aStartPointAttrOfBase;
+
+ AttributePoint2DPtr anEndPointAttrOfBase;
SketchPlugin_SegmentationTools::getFeaturePoints(
aBaseFeature, aStartPointAttrOfBase, anEndPointAttrOfBase);
FeaturePtr aBaseFeature = ModelAPI_Feature::feature(aBaseObjectAttr->value());
/// points of trim
- AttributePoint2DPtr aStartPointAttrOfBase, anEndPointAttrOfBase;
+ AttributePoint2DPtr aStartPointAttrOfBase;
+
+ AttributePoint2DPtr anEndPointAttrOfBase;
SketchPlugin_SegmentationTools::getFeaturePoints(
aBaseFeature, aStartPointAttrOfBase, anEndPointAttrOfBase);
FeaturePtr aBaseFeature = ModelAPI_Feature::feature(aBaseObjectAttr->value());
// points of trim
- AttributePoint2DPtr aStartPointAttrOfBase, anEndPointAttrOfBase;
+ AttributePoint2DPtr aStartPointAttrOfBase;
+
+ AttributePoint2DPtr anEndPointAttrOfBase;
SketchPlugin_SegmentationTools::getFeaturePoints(
aBaseFeature, aStartPointAttrOfBase, anEndPointAttrOfBase);
const AttributePtr &theAttribute,
const std::list<std::string> & /*theArguments*/,
Events_InfoMessage &theError) const {
- FeaturePtr anEdge1, anEdge2;
+ FeaturePtr anEdge1;
+
+ FeaturePtr anEdge2;
return isValidVertex(theAttribute, theError, anEdge1, anEdge2);
}
}
DeriVector2 BSplineImpl::Value(double u, double du, double *derivparam) {
- DeriVector2 value, deriv;
+ DeriVector2 value;
+
+ DeriVector2 deriv;
d1(u, derivparam, value, deriv);
return value.sum(GCS::DeriVector2(0., 0., deriv.x, deriv.y).mult(du));
}
if (!parameter(p, u))
return DeriVector2();
- DeriVector2 value, deriv;
+ DeriVector2 value;
+
+ DeriVector2 deriv;
d1(u, derivparam, value, deriv);
return deriv.rotate90ccw();
}
if (!aPoint)
continue;
- GCS::InternalAlignmentType anAlignmentX, anAlignmentY;
+ GCS::InternalAlignmentType anAlignmentX;
+
+ GCS::InternalAlignmentType anAlignmentY;
if (anAttribute.first == SketchPlugin_Ellipse::SECOND_FOCUS_ID())
anAlignmentX = GCS::EllipseFocus2X;
else if (anAttribute.first == SketchPlugin_Ellipse::MAJOR_AXIS_START_ID())
GCSPointPtr aPoint1 = thePoint1->point();
GCSPointPtr aPoint2 = thePoint2->point();
- double *aParam1, *aParam2;
+ double *aParam1;
+
+ double *aParam2;
if (theType == CONSTRAINT_HORIZONTAL_DISTANCE) {
aParam1 = aPoint1->x;
aParam2 = aPoint2->x;
void process(StoragePtr theStorage, bool theEvensBlocked);
/// \brief Notify this object about the feature is changed somewhere
- virtual void notify(const FeaturePtr &theFeature,
- PlaneGCSSolver_Update *theUpdater) {}
+ virtual void notify(const FeaturePtr & /*theFeature*/,
+ PlaneGCSSolver_Update * /*theUpdater*/) {}
/// \brief Update constraint
virtual void update();
if (!anEllipseAttr)
return;
- std::pair<std::string, std::string> aMajorAxis, aMinorAxis;
+ std::pair<std::string, std::string> aMajorAxis;
+
+ std::pair<std::string, std::string> aMinorAxis;
ellipseDiameters(theEllipse, aMajorAxis, aMinorAxis);
if (anEllipseAttr->id() == aMajorAxis.first) {
theStart = anEllipseAttr;
SketchSolver_ConstraintType &theType, const ConstraintPtr &theConstraint,
const StoragePtr &theStorage, std::vector<EntityWrapperPtr> &theAttributes,
EntityWrapperPtr theExtremities[2]) {
- AttributePoint2DPtr aPointA, aPointB;
- FeaturePtr anOwnerA, anOwnerB;
- FeaturePtr aParentA, aParentB;
+ AttributePoint2DPtr aPointA;
+
+ AttributePoint2DPtr aPointB;
+ FeaturePtr anOwnerA;
+
+ FeaturePtr anOwnerB;
+ FeaturePtr aParentA;
+
+ FeaturePtr aParentB;
getPointOwnerAndParent(
theConstraint->refattr(SketchPlugin_Constraint::ENTITY_A()), aPointA,
anOwnerA, aParentA);
theConstraint->refattr(SketchPlugin_Constraint::ENTITY_B()), aPointB,
anOwnerB, aParentB);
- AttributePtr anAxisStart, anAxisEnd, aPoint;
- FeaturePtr aConstruction, anEllipticArc;
+ AttributePtr anAxisStart;
+
+ AttributePtr anAxisEnd;
+
+ AttributePtr aPoint;
+ FeaturePtr aConstruction;
+
+ FeaturePtr anEllipticArc;
if (aParentA && aParentA == anOwnerB) {
aPoint = aPointB;
aConstruction = anOwnerA;
AttributeRefAttrPtr aRefAttrB =
myBaseConstraint->refattr(SketchPlugin_Constraint::ENTITY_B());
if (aRefAttrA && aRefAttrB) {
- AttributePoint2DPtr anAttrA, anAttrB;
- FeaturePtr anOwnerA, anOwnerB;
- FeaturePtr aParentA, aParentB;
+ AttributePoint2DPtr anAttrA;
+
+ AttributePoint2DPtr anAttrB;
+ FeaturePtr anOwnerA;
+
+ FeaturePtr anOwnerB;
+ FeaturePtr aParentA;
+
+ FeaturePtr aParentB;
getPointOwnerAndParent(aRefAttrA, anAttrA, anOwnerA, aParentA);
getPointOwnerAndParent(aRefAttrB, anAttrB, anOwnerB, aParentB);
- EntityWrapperPtr aPoint, anEntity;
+ EntityWrapperPtr aPoint;
+
+ EntityWrapperPtr anEntity;
if (aParentA == anOwnerB) {
aPoint = myStorage->entity(anAttrA);
anEntity = myStorage->entity(anOwnerB);
if (myIsSigned == isSigned) {
// adjust auxiliary point for sign-keeping
if (isSigned) {
- EntityWrapperPtr aDistPoint, aDistLine;
+ EntityWrapperPtr aDistPoint;
+
+ EntityWrapperPtr aDistLine;
getPointAndLine(myBaseConstraint, myStorage, aDistPoint, aDistLine);
adjustOddPoint(aDistPoint, aDistLine, myOddPoint);
}
// move entities to avoid conflicting constraints
if (isZeroSwitch) {
- double aDirX, aDirY;
+ double aDirX;
+
+ double aDirY;
// calculate the direction basing on the distanced objects
calculateDistanceDirection(myBaseConstraint, myStorage, aDirX, aDirY);
moveEntity(myBaseConstraint, myStorage, aDirX, aDirY);
std::list<GCSConstraintPtr> aGCSConstraints = aConstraint->constraints();
// calculate projection of the point on the line and find a sign of a distance
- EntityWrapperPtr aDistPoint, aDistLine;
+ EntityWrapperPtr aDistPoint;
+
+ EntityWrapperPtr aDistLine;
getPointAndLine(myBaseConstraint, myStorage, aDistPoint, aDistLine);
std::shared_ptr<GeomAPI_Lin2d> aLine = PlaneGCSSolver_Tools::line(aDistLine);
std::list<ObjectPtr> aBaseList = aBaseRefList->list();
std::list<ObjectPtr> aMirroredList = aMirroredRefList->list();
- std::list<ObjectPtr>::iterator aBIt, aMIt;
+ std::list<ObjectPtr>::iterator aBIt;
+
+ std::list<ObjectPtr>::iterator aMIt;
for (aBIt = aBaseList.begin(), aMIt = aMirroredList.begin();
aBIt != aBaseList.end() && aMIt != aMirroredList.end(); ++aBIt, ++aMIt) {
FeaturePtr aBase = ModelAPI_Feature::feature(*aBIt);
}
// mirror all initialized points of features
- std::list<AttributePtr>::iterator anIt0, anIt1;
+ std::list<AttributePtr>::iterator anIt0;
+
+ std::list<AttributePtr>::iterator anIt1;
for (anIt0 = aPoints0.begin(), anIt1 = aPoints1.begin();
anIt0 != aPoints0.end() && anIt1 != aPoints1.end(); ++anIt0, ++anIt1) {
AttributePoint2DPtr aPt0 =
return;
}
- FeaturePtr anOriginal, aFeature;
- std::list<double>::iterator aXIt, aYIt;
+ FeaturePtr anOriginal;
+
+ FeaturePtr aFeature;
+ std::list<double>::iterator aXIt;
+
+ std::list<double>::iterator aYIt;
std::list<ObjectPtr> anObjectList = aRefList->list();
auto anObjIt = anObjectList.begin();
continue;
// Fill lists of coordinates of points composing a feature
- std::list<double> aX, aY;
- double aXCoord, aYCoord;
+ std::list<double> aX;
+
+ std::list<double> aY;
+ double aXCoord;
+
+ double aYCoord;
std::list<AttributePtr> aPoints =
anOriginal->data()->attributes(GeomDataAPI_Point2D::typeId());
auto aPtIt = aPoints.begin();
return;
}
- EntityWrapperPtr aStartPoint, aEndPoint;
+ EntityWrapperPtr aStartPoint;
+
+ EntityWrapperPtr aEndPoint;
std::list<EntityWrapperPtr> aBaseEntities;
getAttributes(aStartPoint, aEndPoint, myIsFullValue, aBaseEntities);
if (!myErrorMsg.empty())
return;
}
- FeaturePtr aFeature1, aFeature2;
+ FeaturePtr aFeature1;
+
+ FeaturePtr aFeature2;
getFeatures(myBaseConstraint, aFeature1, aFeature2);
// check number of coincident points
if (!myBaseConstraint->data() || !myBaseConstraint->data()->isValid())
return;
- FeaturePtr aTgFeat1, aTgFeat2;
+ FeaturePtr aTgFeat1;
+
+ FeaturePtr aTgFeat2;
getFeatures(myBaseConstraint, aTgFeat1, aTgFeat2);
bool isRebuild = false;
aCurve2 = theCurve1;
}
- GeomPnt2dPtr aP1, aP2;
+ GeomPnt2dPtr aP1;
+
+ GeomPnt2dPtr aP2;
if (aCurve2->type() == ENTITY_LINE) {
std::shared_ptr<GeomAPI_Lin2d> aLine = PlaneGCSSolver_Tools::line(aCurve2);
anEllipse->distance(aLine, aP1, aP2);
std::dynamic_pointer_cast<GCS::BSpline>(anEdge->entity());
// which boundary is coincident?
- GCS::Point aPoint1, aPoint2;
+ GCS::Point aPoint1;
+
+ GCS::Point aPoint2;
for (const auto &aCoincidentPoint : aCoincidentPoints) {
if (aCoincidentPoint->owner() == aFeatures[i]) {
if (aCoincidentPoint->id() == SketchPlugin_BSpline::START_ID()) {
if (!myBaseConstraint->data() || !myBaseConstraint->data()->isValid())
return;
- FeaturePtr aTgFeat1, aTgFeat2;
+ FeaturePtr aTgFeat1;
+
+ FeaturePtr aTgFeat2;
getTangentFeatures(myBaseConstraint, aTgFeat1, aTgFeat2);
bool isRebuild = false;
EntityWrapperPtr theEntity2,
EntityWrapperPtr theSharedPoint,
double *theAngle) {
- EdgeWrapperPtr anEntLine, anEntCirc;
+ EdgeWrapperPtr anEntLine;
+
+ EdgeWrapperPtr anEntCirc;
if (theEntity1->type() == ENTITY_LINE) {
anEntLine = GCS_EDGE_WRAPPER(theEntity1);
anEntCirc = GCS_EDGE_WRAPPER(theEntity2);
aCurve2 = theCurve1;
}
- GeomPnt2dPtr aP1, aP2;
+ GeomPnt2dPtr aP1;
+
+ GeomPnt2dPtr aP2;
if (aCurve2->type() == ENTITY_LINE) {
std::shared_ptr<GeomAPI_Lin2d> aLine = PlaneGCSSolver_Tools::line(aCurve2);
anEllipse->distance(aLine, aP1, aP2);
bool SketcherPrs_Angle::IsReadyToDisplay(
ModelAPI_Feature *theConstraint,
const std::shared_ptr<GeomAPI_Ax3> &thePlane) {
- gp_Pnt aFirstPoint, aSecondPoint, aCenterPoint;
+ gp_Pnt aFirstPoint;
+
+ gp_Pnt aSecondPoint;
+
+ gp_Pnt aCenterPoint;
return readyToDisplay(theConstraint, thePlane, aFirstPoint, aSecondPoint,
aCenterPoint);
}
}
gp_Pnt2d aCenterPoint = anAng->center()->impl<gp_Pnt2d>();
- gp_Pnt2d aFirstPoint, aSecondPoint;
+ gp_Pnt2d aFirstPoint;
+
+ gp_Pnt2d aSecondPoint;
try {
if (anAng->angleRadian() > 0.0) {
aFirstPoint = anAng->firstPoint()->impl<gp_Pnt2d>();
DataPtr aData = myConstraint->data();
- gp_Pnt aFirstPoint, aSecondPoint, aCenterPoint;
+ gp_Pnt aFirstPoint;
+
+ gp_Pnt aSecondPoint;
+
+ gp_Pnt aCenterPoint;
bool aReadyToDisplay = readyToDisplay(myConstraint, plane(), aFirstPoint,
aSecondPoint, aCenterPoint);
if (aReadyToDisplay) {
bool SketcherPrs_LengthDimension::IsReadyToDisplay(
ModelAPI_Feature *theConstraint,
const std::shared_ptr<GeomAPI_Ax3> &thePlane) {
- gp_Pnt2d aPnt1, aPnt2;
+ gp_Pnt2d aPnt1;
+
+ gp_Pnt2d aPnt2;
return readyToDisplay(theConstraint, thePlane, aPnt1, aPnt2);
}
const Standard_Integer theMode) {
if (!plane().get())
return;
- gp_Pnt2d aP1, aP2;
+ gp_Pnt2d aP1;
+
+ gp_Pnt2d aP2;
bool aReadyToDisplay = readyToDisplay(myConstraint, plane(), aP1, aP2);
if (aReadyToDisplay) {
if (isEqualPoints(myConstraint, aP1, aP2)) {
std::shared_ptr<GeomDataAPI_Dir> aDirAttr =
std::dynamic_pointer_cast<GeomDataAPI_Dir>(myConstraint->attribute(
SketchPlugin_ConstraintDistance::DIRECTION_ID()));
- double x = 0.0, y = 0.0;
+ double x = 0.0;
+
+ double y = 0.0;
if (aDirAttr && aDirAttr->isInitialized()) {
x = aDirAttr->x();
y = aDirAttr->y();
// 2458: check correct orientation of the vector
if (aVec.SquareMagnitude() > Precision::Confusion()) {
std::shared_ptr<GeomAPI_Edge> aCircEdge(new GeomAPI_Edge(aShape));
- double aFirstParam, aLastParam;
+ double aFirstParam;
+
+ double aLastParam;
aCircEdge->getRange(aFirstParam, aLastParam);
// if parameter is near the LastParam, make the vector go inside
// (reverse)
std::list<AttributePtr> anObjectAttiributes =
anObjectFeature->data()->attributes(GeomDataAPI_Point2D::typeId());
std::list<AttributePtr>::const_iterator anIt =
- anObjectAttiributes.begin(),
- aLast =
- anObjectAttiributes.end();
+
+ anObjectAttiributes.begin();
+
+ std::list<AttributePtr>::const_iterator aLast =
+
+ anObjectAttiributes.end();
for (; anIt != aLast && !aGeomPoint; anIt++) {
std::shared_ptr<GeomDataAPI_Point2D> anAttributePoint =
std::dynamic_pointer_cast<GeomDataAPI_Point2D>(*anIt);
QList<QAction *> anActionsList = theMenu->actions();
int anActionsListSize = anActionsList.size();
QAction *aFirstAction = anActionsList[0];
- QMap<int, QAction *>::const_iterator anIt = aMenuActions.begin(),
- aLast = aMenuActions.end();
+ QMap<int, QAction *>::const_iterator anIt = aMenuActions.begin();
+
+ QMap<int, QAction *>::const_iterator aLast = aMenuActions.end();
for (; anIt != aLast; anIt++) {
if (anIt.key() > anActionsListSize)
theMenu->addAction(anIt.value());
QStringList aGroups;
QMap<std::string, QActionsList>::const_iterator anIt =
- myObjBrowserMenus.begin(),
- aLast =
- myObjBrowserMenus.end();
+
+ myObjBrowserMenus.begin();
+
+ QMap<std::string, QActionsList>::const_iterator aLast =
+
+ myObjBrowserMenus.end();
for (; anIt != aLast; anIt++) {
QString aGroupName(anIt.key().c_str());
if (aGroups.contains(aGroupName))
continue;
QActionsList anActions = anIt.value();
- QActionsList::const_iterator anAIt = anActions.begin(),
- anALast = anActions.end();
+ QActionsList::const_iterator anAIt = anActions.begin();
+
+ QActionsList::const_iterator anALast = anActions.end();
bool aFound = false;
for (; anAIt != anALast && !aFound; anAIt++)
aFound = (*anAIt)->data().toString() == theName;
QTreeNodesList aNodes = myRoot->objectCreated(aCreated);
ModuleBase_ITreeNode *aParent;
int aRow = 0;
- QModelIndex aParentIndex1, aParentIndex2;
+ QModelIndex aParentIndex1;
+
+ QModelIndex aParentIndex2;
ObjectPtr aObj;
bool aRebuildAll = false;
QString qIntListInfo(const QIntList &theValues,
const QString &theSeparator = QString(", ")) {
QStringList anInfo;
- QIntList::const_iterator anIt = theValues.begin(), aLast = theValues.end();
+ QIntList::const_iterator anIt = theValues.begin();
+
+ QIntList::const_iterator aLast = theValues.end();
for (; anIt != aLast; anIt++) {
anInfo.append(QString::number(*anIt));
}
Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY);
static const ModelAPI_EventCreator *aECreator = ModelAPI_EventCreator::get();
QObjectPtrList aDisplayed = displayedObjects();
- QObjectPtrList::const_iterator anIt = aDisplayed.begin(),
- aLast = aDisplayed.end();
+ QObjectPtrList::const_iterator anIt = aDisplayed.begin();
+
+ QObjectPtrList::const_iterator aLast = aDisplayed.end();
for (; anIt != aLast; anIt++) {
aECreator->sendUpdated(*anIt, EVENT_DISP);
}
// if (!aTrihedron.IsNull())
// deactivateAIS(aTrihedron);
- QObjectPtrList::const_iterator anIt = theObjList.begin(),
- aLast = theObjList.end();
+ QObjectPtrList::const_iterator anIt = theObjList.begin();
+
+ QObjectPtrList::const_iterator aLast = theObjList.end();
for (; anIt != aLast; anIt++) {
selectionActivate()->deactivate(*anIt, false);
}
return Qt::black;
AISObjectPtr anAISObj = getAISObject(theObject);
- int aR, aG, aB;
+ int aR;
+
+ int aG;
+
+ int aB;
anAISObj->getColor(aR, aG, aB);
anAISObj->setColor(theColor.red(), theColor.green(), theColor.blue());
myWorkshop->updateGroupsText();
// find presentations of the feature results
std::list<ResultPtr> aResults;
ModelAPI_Tools::allResults(aFeature, aResults);
- std::list<ResultPtr>::const_iterator anIt = aResults.begin(),
- aLast = aResults.end();
+ std::list<ResultPtr>::const_iterator anIt = aResults.begin();
+
+ std::list<ResultPtr>::const_iterator aLast = aResults.end();
for (; anIt != aLast; ++anIt) {
AISObjectPtr aCurAISObj = getAISObject(*anIt);
if (aCurAISObj.get() != nullptr) {
Handle(V3d_Viewer) aViewer = aContext->CurrentViewer();
Handle(V3d_View) aView = aViewer->ActiveViews().First();
if (!aView.IsNull()) {
- double aEyeX, aEyeY, aEyeZ;
+ double aEyeX;
+
+ double aEyeY;
+
+ double aEyeZ;
aView->Eye(aEyeX, aEyeY, aEyeZ);
- double aProjX, aProjY, aProjZ;
+ double aProjX;
+
+ double aProjY;
+
+ double aProjZ;
aView->Proj(aProjX, aProjY, aProjZ);
GeomPointPtr aPnt = GeomPointPtr(new GeomAPI_Pnt(aEyeX, aEyeY, aEyeZ));
void XGUI_InspectionPanel::setShapeContent(const TopoDS_Shape &theShape) {
try {
OCC_CATCH_SIGNALS;
- int iType, nbTypes[TopAbs_SHAPE];
+ int iType;
+
+ int nbTypes[TopAbs_SHAPE];
for (iType = 0; iType < TopAbs_SHAPE; ++iType) {
nbTypes[iType] = 0;
}
//********************************************************************
void XGUI_InspectionPanel::buildFeaturePane(const FeaturePtr &theFeature) {
- std::string aXmlCfg, aDescription;
+ std::string aXmlCfg;
+
+ std::string aDescription;
myWorkshop->module()->getXMLRepresentation(theFeature->getKind(), aXmlCfg,
aDescription);
if (!aXmlCfg.empty()) {
std::shared_ptr<XGUI_MenuWorkbench>
XGUI_MenuMgr::findWorkbench(const std::string &theWorkbenchName) {
std::list<std::shared_ptr<XGUI_MenuWorkbench>>::const_iterator
- anIt = myWorkbenches.begin(),
+
+ anIt = myWorkbenches.begin();
+
+ std::list<std::shared_ptr<XGUI_MenuWorkbench>>::const_iterator
+
aLast = myWorkbenches.end();
std::shared_ptr<XGUI_MenuWorkbench> aResultWorkbench;
for (; anIt != aLast && !aResultWorkbench; anIt++) {
void XGUI_MenuMgr::createFeatureActions() {
#ifdef HAVE_SALOME
std::list<std::shared_ptr<XGUI_MenuWorkbench>>::const_iterator
- anIt = myWorkbenches.begin(),
+
+ anIt = myWorkbenches.begin();
+
+ std::list<std::shared_ptr<XGUI_MenuWorkbench>>::const_iterator
+
aLast = myWorkbenches.end();
XGUI_SalomeConnector *aSalomeConnector = myWorkshop->salomeConnector();
for (; anIt != aLast; anIt++) {
std::string aWchName = aWorkbench->getName();
const std::list<std::shared_ptr<XGUI_MenuGroup>> &aGroups =
aWorkbench->groups();
- auto aGIt = aGroups.begin(), aGLast = aGroups.end();
+ auto aGIt = aGroups.begin();
+
+ auto aGLast = aGroups.end();
for (; aGIt != aGLast; aGIt++) {
const std::shared_ptr<XGUI_MenuGroup> aGroup = *aGIt;
std::string aGName = aGroup->getName();
const std::list<std::shared_ptr<Config_FeatureMessage>> &aFeaturesInfo =
aGroup->featuresInfo();
- auto aFIt = aFeaturesInfo.begin(), aFLast = aFeaturesInfo.end();
+ auto aFIt = aFeaturesInfo.begin();
+
+ auto aFLast = aFeaturesInfo.end();
size_t aFSize = aFeaturesInfo.size();
for (size_t i = 0; aFIt != aFLast; aFIt++, i++) {
std::shared_ptr<Config_FeatureMessage> aMessage = *aFIt;
std::shared_ptr<XGUI_MenuGroup>
XGUI_MenuWorkbench::findGroup(const std::string &theGroupName) {
std::list<std::shared_ptr<XGUI_MenuGroup>>::const_iterator
- anIt = myGroups.begin(),
+
+ anIt = myGroups.begin();
+
+ std::list<std::shared_ptr<XGUI_MenuGroup>>::const_iterator
+
aLast = myGroups.end();
std::shared_ptr<XGUI_MenuGroup> aResultGroup;
for (; anIt != aLast && !aResultGroup; anIt++) {
myTreeView->update(aIdx);
}
- QModelIndex aIndex0, aIndex1, aIndex2, aCurrent;
+ QModelIndex aIndex0;
+
+ QModelIndex aIndex1;
+
+ QModelIndex aIndex2;
+
+ QModelIndex aCurrent;
foreach (ObjectPtr aFeature, aToSelect) {
aIndex1 = myDocModel->objectIndex(aFeature, 1);
if (aIndex1.isValid()) {
}
bool XGUI_OperationMgr::commitAllOperations() {
- bool isCompositeCommitted = false, anOperationProcessed = false;
+ bool isCompositeCommitted = false;
+
+ bool anOperationProcessed = false;
while (hasOperation()) {
ModuleBase_Operation *anOperation = currentOperation();
if (XGUI_Tools::workshop(myWorkshop)->errorMgr()->isApplyEnabled()) {
/// of restarted operation and after that the mouse release signal come from
/// the widget of the previous operation (Point2d widget about mouse is
/// released and focus is out of this widget)
- QList<ModuleBase_ModelWidget *>::const_iterator anIt = myWidgets.begin(),
- aLast = myWidgets.end();
+ QList<ModuleBase_ModelWidget *>::const_iterator anIt = myWidgets.begin();
+
+ QList<ModuleBase_ModelWidget *>::const_iterator aLast = myWidgets.end();
for (; anIt != aLast; anIt++) {
QWidget *aWidget = *anIt;
if (aWidget) {
ModelAPI_ValidatorsFactory *aValidators =
ModelAPI_Session::get()->validators();
- QList<ModuleBase_ModelWidget *>::const_iterator anIt = myWidgets.begin(),
- aLast = myWidgets.end();
+ QList<ModuleBase_ModelWidget *>::const_iterator anIt = myWidgets.begin();
+
+ QList<ModuleBase_ModelWidget *>::const_iterator aLast = myWidgets.end();
bool isFoundWidget = false;
ModuleBase_Tools::activateWindow(this,
"XGUI_PropertyPanel::activateNextWidget()");
return false;
}
std::string aPreviosAttributeID;
- ModuleBase_ModelWidget *aDeactivatedWidget = nullptr,
- *anActivatedWidget = nullptr;
+ ModuleBase_ModelWidget *aDeactivatedWidget = nullptr;
+
+ ModuleBase_ModelWidget *anActivatedWidget = nullptr;
if (myActiveWidget) {
aPreviosAttributeID = myActiveWidget->attributeID();
myActiveWidget->processValueState();
// objects in the result
QObjectPtrList aPresentationObjects;
QList<ModuleBase_ViewerPrsPtr>::const_iterator aPrsIt =
- thePresentations.begin(),
- aPrsLast =
- thePresentations.end();
+
+ thePresentations.begin();
+
+ QList<ModuleBase_ViewerPrsPtr>::const_iterator aPrsLast =
+
+ thePresentations.end();
for (; aPrsIt != aPrsLast; aPrsIt++) {
aPresentationObjects.push_back((*aPrsIt)->object());
}
QObjectPtrList anObjects = selectedObjects();
- QObjectPtrList::const_iterator anIt = anObjects.begin(),
- aLast = anObjects.end();
+ QObjectPtrList::const_iterator anIt = anObjects.begin();
+
+ QObjectPtrList::const_iterator aLast = anObjects.end();
for (; anIt != aLast; anIt++) {
ObjectPtr anObject = *anIt;
if (anObject.get() != nullptr && !aPresentationObjects.contains(anObject)) {
Handle(StdSelect_BRepOwner) aOwner;
Handle(AIS_InteractiveObject) anIO;
bool isDisplayed = false;
- TopoDS_Shape aShape, aShp;
+ TopoDS_Shape aShape;
+
+ TopoDS_Shape aShp;
ResultPtr aRes;
XGUI_Displayer *aDisplayer = myWorkshop->displayer();
for (aContext->InitDetected(); aContext->MoreDetected();
anIsAutoPreview = aFeatureInfo->isAutoPreview();
theOperation->setHelpFileName(aFeatureInfo->helpFileName().c_str());
} else {
- std::string aXmlCfg, aDescription;
+ std::string aXmlCfg;
+
+ std::string aDescription;
module()->getXMLRepresentation(aFeatureKind, aXmlCfg, aDescription);
ModuleBase_WidgetFactory aFactory(aXmlCfg, moduleConnector());
anIsAutoPreview =
aDone = ModelAPI_Tools::removeFeatures(aFeatures, false);
}
if (aFolders.size() > 0) {
- auto anIt = aFolders.begin(), aLast = aFolders.end();
+ auto anIt = aFolders.begin();
+
+ auto aLast = aFolders.end();
for (; anIt != aLast; anIt++) {
FolderPtr aFolder = *anIt;
if (aFolder.get()) {
// references to it
std::set<FeaturePtr> aMainReferences = theMainList.at(theFeature);
- auto anIt = aMainReferences.begin(), aLast = aMainReferences.end();
+ auto anIt = aMainReferences.begin();
+
+ auto aLast = aMainReferences.end();
for (; anIt != aLast; anIt++) {
FeaturePtr aRefFeature = *anIt;
if (theReferences.find(aRefFeature) == theReferences.end())
// dependency to bool_1 sk_3() Information: bool_1 is not selected
std::set<FeaturePtr> anUnusedObjects;
std::map<FeaturePtr, std::set<FeaturePtr>>::const_iterator
- aMainIt = aReferences.begin(),
+
+ aMainIt = aReferences.begin();
+
+ std::map<FeaturePtr, std::set<FeaturePtr>>::const_iterator
+
aMainLast = aReferences.end();
for (; aMainIt != aMainLast; aMainIt++) {
FeaturePtr aMainListFeature = aMainIt->first;
std::set<FeaturePtr> aMainRefList = aMainIt->second;
- auto aRefIt = aMainRefList.begin(), aRefLast = aMainRefList.end();
+ auto aRefIt = aMainRefList.begin();
+
+ auto aRefLast = aMainRefList.end();
bool aFeatureOutOfTheList = false;
for (; aRefIt != aRefLast && !aFeatureOutOfTheList; aRefIt++) {
FeaturePtr aRefFeature = *aRefIt;
DocumentPtr anActiveDocument = aMgr->activeDocument();
FeaturePtr aCurrentFeature = anActiveDocument->currentFeature(true);
- std::list<FeaturePtr>::const_iterator anIt = aFList.begin(),
- aLast = aFList.end();
+ std::list<FeaturePtr>::const_iterator anIt = aFList.begin();
+
+ std::list<FeaturePtr>::const_iterator aLast = aFList.end();
for (; anIt != aLast; anIt++) {
FeaturePtr aFeature = *anIt;
if (!aFeature.get() || !myModule->canApplyAction(aFeature, anActionId))
bool aCanMove = !anObjects.empty();
- QObjectPtrList::const_iterator anIt = anObjects.begin(),
- aLast = anObjects.end();
+ QObjectPtrList::const_iterator anIt = anObjects.begin();
+
+ QObjectPtrList::const_iterator aLast = anObjects.end();
for (; anIt != aLast && aCanMove; anIt++) {
ObjectPtr anObject = *anIt;
if (!anObject.get() || !anObject->data().get() ||
theColor.clear();
// get default color from the preferences manager for the given result
if (theColor.empty()) {
- std::string aSection, aName, aDefault;
+ std::string aSection;
+
+ std::string aName;
+
+ std::string aDefault;
theObject->colorConfigInfo(aSection, aName, aDefault);
if (!aSection.empty() && !aName.empty()) {
theColor = Config_PropManager::color(aSection, aName);
myViewerProxy->setColorScaleIntervals(2);
myViewerProxy->setColorScaleRange(0., 1.);
} else {
- double aMin, aMax;
+ double aMin;
+
+ double aMax;
aPrs->dataRange(aMin, aMax);
myViewerProxy->setColorScaleRange(aMin, aMax);
}
std::vector<int> aColor;
ModelAPI_Tools::getColor(aGroup, aColor);
if (aColor.empty()) { // default groups colors
- std::string aSection, aName, aDefault;
+ std::string aSection;
+
+ std::string aName;
+
+ std::string aDefault;
aGroup->colorConfigInfo(aSection, aName, aDefault);
if (!aSection.empty() && !aName.empty()) {
aColor = Config_PropManager::color(aSection, aName);
aNormal->reverse();
GeomPointPtr aPos = aPlane->location();
- double aXmin, aYmin, aZmin, aXmax, aYmax, aZmax;
+ double aXmin;
+
+ double aYmin;
+
+ double aZmin;
+
+ double aXmax;
+
+ double aYmax;
+
+ double aZmax;
aFace->computeSize(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
Handle(V3d_View) aView = myViewerProxy->activeView();