}
// Store result.
- const int aModVertexTag = 1;
- const int aModEdgeTag = 2;
ResultBodyPtr aResultBody = document()->createBody(data());
aResultBody->storeModified(aBaseShape, aResultShape);
aResultBody->loadModifiedShapes(aBuilder, aBaseShape, GeomAPI_Shape::EDGE);
}
GeomShapePtr aSectedEdges = aPaveFiller.shape();
- int anEdgesNum = 0;
+ size_t anEdgesNum = 0;
for(GeomAPI_ShapeExplorer
anExp(aSectedEdges, GeomAPI_Shape::EDGE); anExp.more(); anExp.next()) {
anEdgesNum++;
}
}
}
- if (aFatherGroup.size() < aList->size() && aFatherGroup.size() != 1) // already good
+ if (aFatherGroup.size() < (size_t)aList->size() && aFatherGroup.size() != 1) // already good
break;
- if (aFatherGroup.size() == aList->size()) // no sence to iterate further
+ if (aFatherGroup.size() == (size_t)aList->size()) // no sence to iterate further
break;
if (aFatherGroup.size() == 1 && aList->size() > 1 && aCurrentDepth == aMinDepth)
aSplitAnyway = true; // split anyway, better that just move
std::set<int> aRemoved;
bool aStay = false; // to indicate that the good attribute found stays in the list
- int anIndex = 1; // index of the name assigned to group-feature and result
// added in the order: 3 2 1 orig=0, so, keep the results to give names later
std::list<FeaturePtr> aResults;
for(int aNext = aList->size() - 1; aNext >= 0; aNext--) {
aRemoved.insert(aNext);
FeaturePtr aNew;
- if (aSplitAnyway || aFGroup > aResults.size()) {
+ if (aSplitAnyway || aFGroup > (int)aResults.size()) {
aNew = aDoc->addFeature(ID(), false);
aResults.push_front(aNew); // to keep the order
} else { // appending in already created new result
#ifndef CONFIG_KEYWORDS_H_
#define CONFIG_KEYWORDS_H_
+#if defined __GNUC__ || defined __clang__
+#define MAYBE_UNUSED __attribute__((unused))
+#else
+#define MAYBE_UNUSED
+#endif
+
/*
* Hardcoded xml entities of plugin-*.xml
*/
-const static char* NODE_WORKBENCH = "workbench";
-const static char* NODE_GROUP = "group";
-const static char* NODE_FEATURE = "feature";
-const static char* NODE_SOURCE = "source";
-const static char* NODE_VALIDATOR = "validator";
-const static char* NODE_XMLPARENT = "libxml_parent";
+MAYBE_UNUSED const static char* NODE_WORKBENCH = "workbench";
+MAYBE_UNUSED const static char* NODE_GROUP = "group";
+MAYBE_UNUSED const static char* NODE_FEATURE = "feature";
+MAYBE_UNUSED const static char* NODE_SOURCE = "source";
+MAYBE_UNUSED const static char* NODE_VALIDATOR = "validator";
+MAYBE_UNUSED const static char* NODE_XMLPARENT = "libxml_parent";
// Property panels
-const static char* PROPERTY_PANEL_ID = "property_panel_id";
+MAYBE_UNUSED const static char* PROPERTY_PANEL_ID = "property_panel_id";
// Widgets
-const static char* WDG_INFO = "label";
-const static char* WDG_UNDOLABEL = "undo_label";
-const static char* WDG_DOUBLEVALUE = "doublevalue";
-const static char* WDG_DOUBLEVALUELABEL = "labelvalue";
-const static char* WDG_INTEGERVALUE = "integervalue";
-const static char* WDG_BOOLVALUE = "boolvalue";
-const static char* WDG_STRINGVALUE = "stringvalue";
-const static char* WDG_NAMEVALUE = "namevalue";
-const static char* WDG_MULTISELECTOR = "multi_selector";
-const static char* WDG_SHAPE_SELECTOR = "shape_selector";
-const static char* WDG_FEATURE_SELECTOR = "feature_selector";
-const static char* WDG_CONCEALED_OBJECTS_VIEW = "concealed_objects_view";
-const static char* WDG_CHOICE = "choice";
-const static char* WDG_DOUBLEVALUE_EDITOR = "doublevalue_editor";
-const static char* WDG_FILE_SELECTOR= "file_selector";
-const static char* WDG_EXPR_EDITOR = "expr_editor";
-const static char* WDG_PLACE_HOLDER = "placeholder";
-const static char* WDG_ACTION = "action";
-const static char* WDG_POINT_INPUT = "point_input";
-const static char* WDG_SELECTION_FILTERS = "selection_filters";
+MAYBE_UNUSED const static char* WDG_INFO = "label";
+MAYBE_UNUSED const static char* WDG_UNDOLABEL = "undo_label";
+MAYBE_UNUSED const static char* WDG_DOUBLEVALUE = "doublevalue";
+MAYBE_UNUSED const static char* WDG_DOUBLEVALUELABEL = "labelvalue";
+MAYBE_UNUSED const static char* WDG_INTEGERVALUE = "integervalue";
+MAYBE_UNUSED const static char* WDG_BOOLVALUE = "boolvalue";
+MAYBE_UNUSED const static char* WDG_STRINGVALUE = "stringvalue";
+MAYBE_UNUSED const static char* WDG_NAMEVALUE = "namevalue";
+MAYBE_UNUSED const static char* WDG_MULTISELECTOR = "multi_selector";
+MAYBE_UNUSED const static char* WDG_SHAPE_SELECTOR = "shape_selector";
+MAYBE_UNUSED const static char* WDG_FEATURE_SELECTOR = "feature_selector";
+MAYBE_UNUSED const static char* WDG_CONCEALED_OBJECTS_VIEW = "concealed_objects_view";
+MAYBE_UNUSED const static char* WDG_CHOICE = "choice";
+MAYBE_UNUSED const static char* WDG_DOUBLEVALUE_EDITOR = "doublevalue_editor";
+MAYBE_UNUSED const static char* WDG_FILE_SELECTOR= "file_selector";
+MAYBE_UNUSED const static char* WDG_EXPR_EDITOR = "expr_editor";
+MAYBE_UNUSED const static char* WDG_PLACE_HOLDER = "placeholder";
+MAYBE_UNUSED const static char* WDG_ACTION = "action";
+MAYBE_UNUSED const static char* WDG_POINT_INPUT = "point_input";
+MAYBE_UNUSED const static char* WDG_SELECTION_FILTERS = "selection_filters";
// Containers
-const static char* WDG_GROUP = "groupbox";
-const static char* WDG_OPTIONALBOX = "optionalbox";
-const static char* WDG_TOOLBOX = "toolbox";
-const static char* WDG_RADIOBOX = "radiobox";
-const static char* WDG_RADIOBOX_ITEM = "radio";
-const static char* WDG_TOOLBOX_BOX = "box";
-const static char* WDG_SWITCH = "switch";
-const static char* WDG_SWITCH_CASE = "case";
-const static char* WDG_FILTER = "filter";
+MAYBE_UNUSED const static char* WDG_GROUP = "groupbox";
+MAYBE_UNUSED const static char* WDG_OPTIONALBOX = "optionalbox";
+MAYBE_UNUSED const static char* WDG_TOOLBOX = "toolbox";
+MAYBE_UNUSED const static char* WDG_RADIOBOX = "radiobox";
+MAYBE_UNUSED const static char* WDG_RADIOBOX_ITEM = "radio";
+MAYBE_UNUSED const static char* WDG_TOOLBOX_BOX = "box";
+MAYBE_UNUSED const static char* WDG_SWITCH = "switch";
+MAYBE_UNUSED const static char* WDG_SWITCH_CASE = "case";
+MAYBE_UNUSED const static char* WDG_FILTER = "filter";
// Common properties (xml attributes of nodes)
-const static char* _ID = "id";
+MAYBE_UNUSED const static char* _ID = "id";
// NODE_WORKBENCH properties
-const static char* WORKBENCH_DOC = "document";
+MAYBE_UNUSED const static char* WORKBENCH_DOC = "document";
// NODE_SOURCE properties
-const static char* SOURCE_FILE = "path";
+MAYBE_UNUSED const static char* SOURCE_FILE = "path";
// NODE_FEATURE properties
-const static char* FEATURE_TOOLTIP = "tooltip";
-const static char* GROUP_TOOLBAR = "toolbar";
-const static char* FEATURE_ICON = "icon";
-const static char* FEATURE_TEXT = "title";
-const static char* HELP_FILE = "helpfile";
-const static char* ABORT_CONFIRMATION = "abort_confirmation";
-const static char* HIDEFACES_PANEL = "hidefaces_panel";
-const static char* FEATURE_KEYSEQUENCE = "keysequence";
-const static char* FEATURE_NESTED = "nested";
-const static char* FEATURE_WHEN_NESTED = "when_nested";
-const static char* FEATURE_WHEN_NESTED_ACCEPT = "accept";
-const static char* FEATURE_WHEN_NESTED_ABORT = "abort";
-const static char* FEATURE_DOC = WORKBENCH_DOC;
-const static char* FEATURE_MODAL = "modal";
-const static char* FEATURE_APPLY_CONTINUE = "apply_continue";
-const static char* FEATURE_AUTO_PREVIEW = "auto_preview";
-const static char* FEATURE_TITLE_IN_TOOLBAR = "titleInToolbar";
+MAYBE_UNUSED const static char* FEATURE_TOOLTIP = "tooltip";
+MAYBE_UNUSED const static char* GROUP_TOOLBAR = "toolbar";
+MAYBE_UNUSED const static char* FEATURE_ICON = "icon";
+MAYBE_UNUSED const static char* FEATURE_TEXT = "title";
+MAYBE_UNUSED const static char* HELP_FILE = "helpfile";
+MAYBE_UNUSED const static char* ABORT_CONFIRMATION = "abort_confirmation";
+MAYBE_UNUSED const static char* HIDEFACES_PANEL = "hidefaces_panel";
+MAYBE_UNUSED const static char* FEATURE_KEYSEQUENCE = "keysequence";
+MAYBE_UNUSED const static char* FEATURE_NESTED = "nested";
+MAYBE_UNUSED const static char* FEATURE_WHEN_NESTED = "when_nested";
+MAYBE_UNUSED const static char* FEATURE_WHEN_NESTED_ACCEPT = "accept";
+MAYBE_UNUSED const static char* FEATURE_WHEN_NESTED_ABORT = "abort";
+MAYBE_UNUSED const static char* FEATURE_DOC = WORKBENCH_DOC;
+MAYBE_UNUSED const static char* FEATURE_MODAL = "modal";
+MAYBE_UNUSED const static char* FEATURE_APPLY_CONTINUE = "apply_continue";
+MAYBE_UNUSED const static char* FEATURE_AUTO_PREVIEW = "auto_preview";
+MAYBE_UNUSED const static char* FEATURE_TITLE_IN_TOOLBAR = "titleInToolbar";
// NODE_VALIDATOR properties
-const static char* _PARAMETERS = "parameters";
+MAYBE_UNUSED const static char* _PARAMETERS = "parameters";
// Widget (attribute) properties
-const static char* ATTR_TOOLTIP = FEATURE_TOOLTIP;
-const static char* ATTR_ICON = FEATURE_ICON;
-const static char* ATTR_LABEL = "label";
-const static char* ATTR_STYLE_SHEET = "styleSheet";
-const static char* ATTR_HTML_STYLE = "isHTML";
-const static char* ATTR_DEFAULT = "default";
-const static char* ATTR_INTERNAL = "internal";
-const static char* ATTR_OBLIGATORY = "obligatory";
-const static char* ATTR_CONCEALMENT = "concealment";
-const static char* ATTR_USE_RESET = "use_reset";
-const static char* ATTR_GREED = "greed";
-const static char* ATTR_MODIFIED_IN_EDIT = "modified_in_edit";
-const static char* ATTR_MAIN_ARG = "main_argument";
-const static char* ATTR_GEOMETRICAL_SELECTION = "geometrical_selection";
-const static char* ATTR_VISUAL_CHANGED = "change_visual_attributes";
+MAYBE_UNUSED const static char* ATTR_TOOLTIP = FEATURE_TOOLTIP;
+MAYBE_UNUSED const static char* ATTR_ICON = FEATURE_ICON;
+MAYBE_UNUSED const static char* ATTR_LABEL = "label";
+MAYBE_UNUSED const static char* ATTR_STYLE_SHEET = "styleSheet";
+MAYBE_UNUSED const static char* ATTR_HTML_STYLE = "isHTML";
+MAYBE_UNUSED const static char* ATTR_DEFAULT = "default";
+MAYBE_UNUSED const static char* ATTR_INTERNAL = "internal";
+MAYBE_UNUSED const static char* ATTR_OBLIGATORY = "obligatory";
+MAYBE_UNUSED const static char* ATTR_CONCEALMENT = "concealment";
+MAYBE_UNUSED const static char* ATTR_USE_RESET = "use_reset";
+MAYBE_UNUSED const static char* ATTR_GREED = "greed";
+MAYBE_UNUSED const static char* ATTR_MODIFIED_IN_EDIT = "modified_in_edit";
+MAYBE_UNUSED const static char* ATTR_MAIN_ARG = "main_argument";
+MAYBE_UNUSED const static char* ATTR_GEOMETRICAL_SELECTION = "geometrical_selection";
+MAYBE_UNUSED const static char* ATTR_VISUAL_CHANGED = "change_visual_attributes";
// WDG_INFO properties
-const static char* INFO_WDG_TEXT = FEATURE_TEXT;
-const static char* INFO_WDG_TOOLTIP = FEATURE_TOOLTIP;
+MAYBE_UNUSED const static char* INFO_WDG_TEXT = FEATURE_TEXT;
+MAYBE_UNUSED const static char* INFO_WDG_TOOLTIP = FEATURE_TOOLTIP;
// WDG_DOUBLEVALUE properties:
-const static char* DOUBLE_WDG_MIN = "min";
-const static char* DOUBLE_WDG_MAX = "max";
-const static char* DOUBLE_WDG_STEP = "step";
-const static char* DOUBLE_WDG_DEFAULT_COMPUTED = "computed";
-const static char* DOUBLE_WDG_ACCEPT_EXPRESSIONS = "accept_expressions";
-const static char* DOUBLE_WDG_ENABLE_VALUE = "enable_value";
+MAYBE_UNUSED const static char* DOUBLE_WDG_MIN = "min";
+MAYBE_UNUSED const static char* DOUBLE_WDG_MAX = "max";
+MAYBE_UNUSED const static char* DOUBLE_WDG_STEP = "step";
+MAYBE_UNUSED const static char* DOUBLE_WDG_DEFAULT_COMPUTED = "computed";
+MAYBE_UNUSED const static char* DOUBLE_WDG_ACCEPT_EXPRESSIONS = "accept_expressions";
+MAYBE_UNUSED const static char* DOUBLE_WDG_ENABLE_VALUE = "enable_value";
-const static char* DOUBLE_WDG_ENABLE_VALUE_BY_PREFERENCES = "enable_by_preferences";
+MAYBE_UNUSED const static char* DOUBLE_WDG_ENABLE_VALUE_BY_PREFERENCES = "enable_by_preferences";
// WDG_TOOLBOX/WDG_SWITCH properties
-const static char* CONTAINER_PAGE_NAME = "title";
-const static char* CONTAINER_PAGE_ICON = "icon";
+MAYBE_UNUSED const static char* CONTAINER_PAGE_NAME = "title";
+MAYBE_UNUSED const static char* CONTAINER_PAGE_ICON = "icon";
/*
* Hardcoded xml entities of plugins.xml
*/
-const static char* PLUGIN_FILE = "plugins.xml";
-const static char* NODE_PLUGIN = "plugin";
-const static char* NODE_PLUGINS = "plugins";
+MAYBE_UNUSED const static char* PLUGIN_FILE = "plugins.xml";
+MAYBE_UNUSED const static char* NODE_PLUGIN = "plugin";
+MAYBE_UNUSED const static char* NODE_PLUGINS = "plugins";
-const static char* PLUGINS_MODULE = "module";
-const static char* PLUGIN_CONFIG = "configuration";
-const static char* PLUGIN_LIBRARY = "library";
-const static char* PLUGIN_SCRIPT = "script";
-const static char* PLUGIN_DEPENDENCY = "dependency";
-const static char* PLUGIN_USES = "uses";
+MAYBE_UNUSED const static char* PLUGINS_MODULE = "module";
+MAYBE_UNUSED const static char* PLUGIN_CONFIG = "configuration";
+MAYBE_UNUSED const static char* PLUGIN_LIBRARY = "library";
+MAYBE_UNUSED const static char* PLUGIN_SCRIPT = "script";
+MAYBE_UNUSED const static char* PLUGIN_DEPENDENCY = "dependency";
+MAYBE_UNUSED const static char* PLUGIN_USES = "uses";
/*
* Hardcoded xml entities of dataModel.xml
*/
-const static char* DATAMODEL_FILE = "dataModel.xml";
-const static char* NODE_FOLDER = "folder";
-const static char* FOLDER_NAME = "name";
-const static char* GROUP_TYPE = "group_type";
-const static char* ROOT_DOCUMENT = "root_document";
-const static char* SUB_DOCUMENT = "sub_document";
-const static char* NODE_ICON = "icon";
-const static char* SHOW_EMPTY = "show_empty";
-const static char* LINK_ITEM = "from_result";
-const static char* FOLDER_FEATURES = "folder_features";
+MAYBE_UNUSED const static char* DATAMODEL_FILE = "dataModel.xml";
+MAYBE_UNUSED const static char* NODE_FOLDER = "folder";
+MAYBE_UNUSED const static char* FOLDER_NAME = "name";
+MAYBE_UNUSED const static char* GROUP_TYPE = "group_type";
+MAYBE_UNUSED const static char* ROOT_DOCUMENT = "root_document";
+MAYBE_UNUSED const static char* SUB_DOCUMENT = "sub_document";
+MAYBE_UNUSED const static char* NODE_ICON = "icon";
+MAYBE_UNUSED const static char* SHOW_EMPTY = "show_empty";
+MAYBE_UNUSED const static char* LINK_ITEM = "from_result";
+MAYBE_UNUSED const static char* FOLDER_FEATURES = "folder_features";
#endif /* CONFIG_KEYWORDS_H_ */
// use all 8 points of the bounding box to find the 2D bounds
bool isFirst = true;
- double aMinX2d, aMaxX2d, aMinY2d, aMaxY2d;
+ double aMinX2d = DBL_MAX, aMaxX2d = -DBL_MAX;
+ double aMinY2d = DBL_MAX, aMaxY2d = -DBL_MAX;
for(int aXIsMin = 0; aXIsMin < 2; aXIsMin++) {
for(int aYIsMin = 0; aYIsMin < 2; aYIsMin++) {
for(int aZIsMin = 0; aZIsMin < 2; aZIsMin++) {
bool isCustomized = theDefaultPrs.get() != NULL &&
theDefaultPrs->customisePresentation(theResult, thePrs, theDefaultPrs);
//thePrs->setPointMarker(1, 1.); // Set point as a '+' symbol
- return true;
+ return isCustomized;
}
//==================================================================================================
aShape2 = aContext2->shape();
}
- bool isPlaneFirst = false;
anEdge = getEdge(aShape1);
-
aFace = getFace(aShape2);
if(!anEdge.get() || !aFace.get()) {
anEdge = getEdge(aShape2);
aFace = getFace(aShape1);
- isPlaneFirst = true;
}
if(!anEdge.get() || !aFace.get()) {
// TODO: Stabilization fix. Check later.
if(myFlushed.find(theID.myID) != myFlushed.end()) {
myFlushed.erase(myFlushed.find(theID.myID));
- } else {
+ }
+#ifdef _DEBUG
+ else {
bool aProblem = true;
}
+#endif
}
// send accumulated messages to "groupListeners"
std::map<char*, std::map<void*, std::list<Events_Listener*> > >::iterator aFindID =
anError = "Unsupported format: " + aFormatName;
}
- if (!anError.empty()) {
+ if (!aResult || !anError.empty()) {
setError("An error occurred while exporting " + theFileName + ": " + anError);
return;
}
anAcceptedValues.push_back((*aFIt)->name());
}
- if (aPartsAttr->size() != anAcceptedValues.size())
+ if ((size_t)aPartsAttr->size() != anAcceptedValues.size())
aTargetAttr->setValue(0);
aPartsAttr->setSize((int)anAcceptedValues.size());
//load result
theResultBody->store(theGeomShape);
- int aTag(1);
std::string aNameMS = "Shape";
theResultBody->loadFirstLevel(theGeomShape, aNameMS);
}
anAcceptedValues.push_back((*aFIt)->name());
}
- if (aPartsAttr->size() != anAcceptedValues.size())
+ if ((size_t)aPartsAttr->size() != anAcceptedValues.size())
aTargetAttr->setValue(0);
aPartsAttr->setSize((int)anAcceptedValues.size());
theMakeShapes.push_back(aMakeShapeList);
break;
}
+ default: // [to avoid compilation warnings]
+ break;
}
return true;
case GeomAPI_Shape::COMPOUND: {
aShapeTypeToExplode = GeomAPI_Shape::COMPOUND;
}
+ default: // [to avoid compilation warnings]
+ break;
}
- int aLateralIndex = 1;
- int aBaseEdgeIndex = 1;
- int aVertexIndex = 1;
- int aBaseVertexIndex = 1;
-
if(aShapeTypeToExplode == GeomAPI_Shape::VERTEX ||
aShapeTypeToExplode == GeomAPI_Shape::COMPOUND) {
theResultBody->loadGeneratedShapes(theMakeShape, theBaseShape, GeomAPI_Shape::VERTEX);
aShapeTypeToExplore = GeomAPI_Shape::COMPOUND;
break;
}
+ default: // [to avoid compilation warnings]
+ break;
}
// Store shapes.
// Store generated edges/faces.
GeomAPI_Shape::ShapeType aBaseShapeType = theBaseShape->shapeType();
- GeomAPI_Shape::ShapeType aShapeTypeToExplode;
+ GeomAPI_Shape::ShapeType aShapeTypeToExplode = GeomAPI_Shape::SHAPE;
switch(aBaseShapeType) {
case GeomAPI_Shape::VERTEX: {
case GeomAPI_Shape::COMPOUND: {
aShapeTypeToExplode = GeomAPI_Shape::COMPOUND;
}
+ default:
+ return; // unsupported type of shape
}
if(aShapeTypeToExplode == GeomAPI_Shape::VERTEX ||
{
GeomShapePtr aBaseShape = *anIter;
GeomAPI_Shape::ShapeType aBaseShapeType = aBaseShape->shapeType();
- GeomAPI_Shape::ShapeType aShapeTypeToExplode;
+ GeomAPI_Shape::ShapeType aShapeTypeToExplode = GeomAPI_Shape::SHAPE;
switch(aBaseShapeType) {
case GeomAPI_Shape::VERTEX: {
aShapeTypeToExplode = GeomAPI_Shape::VERTEX;
aShapeTypeToExplode = GeomAPI_Shape::EDGE;
break;
}
+ default:
+ return; // unsupported type of shape
}
aResultBody->loadGeneratedShapes(thePipeAlgo, aBaseShape, aShapeTypeToExplode);
}
aShapeTypeToExplore = GeomAPI_Shape::COMPOUND;
break;
}
+ default:
+ return; // unsupported type of shape
}
// Store shapes.
GeomAPI_Shape::VERTEX,
theName);
}
+ default: // [to avoid compilation warning]
+ break;
}
}
// LCOV_EXCL_STOP
}
- std::list<std::string>::const_iterator
- anArgsIt = theArguments.begin(), aLast = theArguments.end();
+ std::list<std::string>::const_iterator anArgsIt = theArguments.begin();
AttributePtr aCheckAttribute = theFeature->attribute(*anArgsIt);
++anArgsIt;
}
for(int anIndex = 0; anIndex < aBaseObjectsAttrList->size(); ++anIndex) {
- bool isSameFound = false;
AttributeSelectionPtr anAttrSelectionInList = aBaseObjectsAttrList->value(anIndex);
ResultPtr aContext = anAttrSelectionInList->context();
if (!aContext.get()) {
int anObjectsNb = 0, aToolsNb = 0;
- std::list<std::string>::const_iterator anIt = theArguments.begin(), aLast = theArguments.end();
+ std::list<std::string>::const_iterator anIt = theArguments.begin();
bool isAllInSameCompSolid = true;
ResultBodyPtr aCompSolid;
}
}
- anIt++;
-
if (anObjectsNb + aToolsNb < 2) {
theError = "Not enough arguments for Fuse operation.";
return false;
int anObjectsNb = 0, aToolsNb = 0;
- std::list<std::string>::const_iterator anIt = theArguments.begin(), aLast = theArguments.end();
+ std::list<std::string>::const_iterator anIt = theArguments.begin();
- bool isAllInSameCompSolid = true;
ResultBodyPtr aCompSolid;
AttributeSelectionListPtr anAttrSelList = theFeature->selectionList(*anIt);
case GeomAPI_Shape::EDGE:
case GeomAPI_Shape::VERTEX:
return true;
+ default: // [to avoid compilation warning]
+ break;
}
return false;
}
// (if shapes are connected, vertices are connected for sure)
TopExp_Explorer anExp2(aNewIter.Value(), TopAbs_VERTEX);
for(; !aConnected && anExp2.More(); anExp2.Next()) {
- NCollection_List<TopoDS_Shape>::Iterator aNotIter(aNotVertices);
- for(; aNotIter.More(); aNotIter.Next()) {
- if (aNotIter.Value().IsSame(anExp2.Current())) {
+ NCollection_List<TopoDS_Shape>::Iterator aNotVIter(aNotVertices);
+ for(; aNotVIter.More(); aNotVIter.Next()) {
+ if (aNotVIter.Value().IsSame(anExp2.Current())) {
aConnected = true;
break;
}
void GeomAPI_Shape::setOrientation(const GeomAPI_Shape::Orientation theOrientation)
{
- TopAbs_Orientation anOrientation = MY_SHAPE->Orientation();
-
switch(theOrientation) {
case FORWARD: MY_SHAPE->Orientation(TopAbs_FORWARD); break;
case REVERSED: MY_SHAPE->Orientation(TopAbs_REVERSED); break;
GeomPointPtr aLocation;
GeomDirPtr anAxis;
- double aRadius;
- double aHeight;
+ double aRadius = 0.0;
+ double aHeight = 0.0;
for (TopExp_Explorer anExp(impl<TopoDS_Shape>(), TopAbs_FACE); anExp.More(); anExp.Next()) {
GeomFacePtr aFace(new GeomAPI_Face);
GeomPointPtr anApex;
GeomDirPtr anAxis;
- double aSemiAngle, aTanSemiAngle;
- double aHeight1, aHeight2;
+ double aSemiAngle = 0.0, aTanSemiAngle = 0.0;
+ double aHeight1 = 0.0, aHeight2 = 0.0;
for (TopExp_Explorer anExp(impl<TopoDS_Shape>(), TopAbs_FACE); anExp.More(); anExp.Next()) {
GeomFacePtr aFace(new GeomAPI_Face);
double aSign = anAxis->dot(aCurCone->axis());
double aCurSemiAngle = aCurCone->semiAngle();
- double aTanCurSemiAngle = Tan(aSemiAngle);
+ double aTanCurSemiAngle = Tan(aCurSemiAngle);
double aH = aCurCone->radius1() / aTanCurSemiAngle * aSign;
if (aH < aHeight1)
GeomPointPtr aLocation;
GeomDirPtr anAxis;
- double aRadius;
- double aHeight;
+ double aRadius = 0.0;
+ double aHeight = 0.0;
GeomPlanePtr aCaps[2];
GeomPointPtr anApex;
GeomDirPtr anAxis;
- double aSemiAngle;
- double aHeight;
+ double aSemiAngle = 0.0;
+ double aHeight = 0.0;
GeomPlanePtr aCaps[2];
GeomShapePtr aTypedShape = theShape;
- GeomAPI_Shape::ShapeType aType = theShape->shapeType();
-
switch (theShape->shapeType()) {
case GeomAPI_Shape::VERTEX:
aTypedShape = GeomShapePtr(new GeomAPI_Vertex(theShape));
case GeomAPI_Shape::WIRE:
aTypedShape = GeomShapePtr(new GeomAPI_Wire(theShape));
break;
+ default:
+ break;
}
return aTypedShape;
myShape->setImpl(new TopoDS_Shape(implPtr<BOPAlgo_Builder>()->Shape()));
break;
}
+ default:
+ break;
}
if(myMap.get()) {
void GeomAlgoAPI_Sewing::modified(const std::shared_ptr<GeomAPI_Shape> theShape,
ListOfShape& theHistory)
{
- static int anIndex = 0;
if(!theShape.get()) {
return;
}
NCollection_Vector<NCollection_Map<TopoDS_Shape>> aShapesWithCommonSubshapes;
for(TopTools_IndexedDataMapOfShapeListOfShape::Iterator
anIter(aMapSA); anIter.More(); anIter.Next()) {
- const TopoDS_Shape& aShape = anIter.Key();
TopTools_ListOfShape& aListOfShape = anIter.ChangeValue();
if(aListOfShape.IsEmpty()) {
continue;
Standard_Real aYArr[2] = {aBndBox.CornerMin().Y(), aBndBox.CornerMax().Y()};
Standard_Real aZArr[2] = {aBndBox.CornerMin().Z(), aBndBox.CornerMax().Z()};
std::list<std::shared_ptr<GeomAPI_Pnt> > aResultPoints;
- int aNum = 0;
for(int i = 0; i < 2; i++) {
for(int j = 0; j < 2; j++) {
for(int k = 0; k < 2; k++) {
{
TopoDS_Wire aFixedWire;
Handle(Geom_Curve) aPrevCurve;
- double aPrevLastParam = 0.0;
+ double aPrevLastParam = -Precision::Infinite();
BRep_Builder aBuilder;
aBuilder.MakeWire(aFixedWire);
TopoDS_Edge anEdge = aWExp.Current();
double aFirst, aLast;
Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, aFirst, aLast);
- if (aCurve == aPrevCurve) {
+ 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;
}
// Check intersections between edges pair-wise
- int aNbEdges = (int)anEdges.size();
std::list<GeomShapePtr>::const_iterator anEdgesIt = anEdges.begin();
for (int i = 0; anEdgesIt != anEdges.end(); ++anEdgesIt, i++) {
GeomEdgePtr anEdge1(new GeomAPI_Edge(*anEdgesIt));
if (MyShapeTypes.size() != 0) {
std::map<std::string, GeomValidators_ShapeType::TypeOfShape>::const_iterator
anIt = MyShapeTypes.begin(), aLast = MyShapeTypes.end();
- for (; anIt != aLast; anIt++) {
- if (anIt->second == theType)
+ for (; anIt != aLast; anIt++)
+ if (anIt->second == theType) {
aValue = anIt->first;
break;
- }
+ }
}
return aValue;
}
}
// LCOV_EXCL_STOP
- std::list<std::string>::const_iterator anIt = theArguments.begin(), aLast = theArguments.end();
+ std::list<std::string>::const_iterator anIt = theArguments.begin();
std::string aSelectedMethod;
if(theFeature->string(*anIt)) {
isDegeneratedEdge = BRep_Tool::Degenerated(TopoDS::Edge(aSubShape)) == Standard_True;
}
if (!theContext.get() || isDegeneratedEdge) {
- // to keep the reference attribute label
- TDF_Label aRefLab = myRef.myRef->Label();
aSelLab.ForgetAllAttributes(true);
myRef.myRef = TDF_Reference::Set(aSelLab.Father(), aSelLab.Father());
if (aToUnblock)
anUpdated = !aSelLab.IsAttribute(kELLIPSE_CENTER2);
TDataStd_UAttribute::Set(aSelLab, kELLIPSE_CENTER2);
break;
+ default: // [to avoid compilation warning]
+ break;
}
if (anUpdated)
owner()->data()->sendAttributeUpdated(this);
if (!aPairIter.More())
return;
TopoDS_Shape aNewCShape = aPairIter.NewShape();
- bool anIterate = true;
// trying to update also the sub-shape selected
GeomShapePtr aSubShape = value();
if (aSubShape.get() && aSubShape->isEqual(aContext->shape()))
case TopAbs_VERTEX: return GENERATED_VERTICES_TAG;
case TopAbs_EDGE: return GENERATED_EDGES_TAG;
case TopAbs_FACE: return GENERATED_FACES_TAG;
+ default: break; // [to avoid compilation warning]
}
return INVALID_TAG;
case TopAbs_VERTEX: return MODIFIED_VERTICES_TAG;
case TopAbs_EDGE: return MODIFIED_EDGES_TAG;
case TopAbs_FACE: return MODIFIED_FACES_TAG;
+ default: break; // [to avoid compilation warning]
}
return INVALID_TAG;
{
std::shared_ptr<Model_Data> aData = std::dynamic_pointer_cast<Model_Data>(data());
if (aData) {
- TDF_Label aShapeLab = aData->shapeLab();
// clean builders
if (theIsCleanStored)
clean();
static const Standard_GUID kEXTERNAL_SHAPE_REF("9aa5dd14-6d34-4a8d-8786-05842fd7bbbd");
Model_Document::Model_Document(const int theID, const std::string theKind)
- : myID(theID), myKind(theKind), myIsActive(false), myIsSetCurrentFeature(false),
- myDoc(new TDocStd_Document("BinOcaf")) // binary OCAF format
+ : myID(theID),
+ myKind(theKind),
+ myDoc(new TDocStd_Document("BinOcaf")), // binary OCAF format
+ myIsActive(false),
+ myIsSetCurrentFeature(false)
{
#ifdef TINSPECTOR
CDF_Session::CurrentSession()->Directory()->Add(myDoc);
TDF_LabelList anAllNewFeatures;
// Perform the copying twice for correct references:
// 1. copy labels hierarchy and fill the relocation table
- TDF_Label aMain = myDoc->Main();
for (TDF_ChildIterator anIt(aTempDoc->Main()); anIt.More(); anIt.Next()) {
TDF_Label aCurrentLab = anIt.Value();
Handle(TDataStd_Comment) aFeatureID;
bool Model_Document::isModified()
{
// is modified if at least one operation was committed and not undone
- return myTransactions.size() != myTransactionSave || isOperation();
+ return (int)myTransactions.size() != myTransactionSave || isOperation();
}
bool Model_Document::canUndo()
}
if (aNumInHistory) {
std::map<std::string, std::list<TDF_Label> >::iterator aFind = myNamingNames.find(aName);
- if (aFind != myNamingNames.end() && aFind->second.size() > aNumInHistory) {
+ if (aFind != myNamingNames.end() && (int)aFind->second.size() > aNumInHistory) {
std::list<TDF_Label>::reverse_iterator aLibIt = aFind->second.rbegin();
for(; aNumInHistory != 0; aNumInHistory--)
aLibIt++;
#include <TDF_LabelMap.hxx>
#include <TDF_ListIteratorOfLabelList.hxx>
+// for TDF_Label map usage
+static Standard_Integer HashCode(const TDF_Label& theLab, const Standard_Integer theUpper);
+static Standard_Boolean IsEqual(const TDF_Label& theLab1, const TDF_Label& theLab2);
+
int kUNDEFINED_FEATURE_INDEX = -1;
static const std::string& groupNameFoldering(const std::string& theGroupID,
return ObjectPtr();
createHistory(theGroupID);
const std::string& aGroupID = groupNameFoldering(theGroupID, theAllowFolder);
- const std::vector<ObjectPtr>& aVec = myHistory[theGroupID];
- //if (aVec.size() <= theIndex)
- // return aVec[aVec.size() - 1]; // too high index requested (to avoid crash in #2360)
return aGroupID.empty() ? myHistory[theGroupID][theIndex] : myHistory[aGroupID][theIndex];
}
return;
// after all updates, sends a message that groups of features were created or updated
Events_Loop* aLoop = Events_Loop::loop();
- static Events_ID aDispEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
- static Events_ID aCreateEvent = Events_Loop::eventByName(EVENT_OBJECT_CREATED);
- static Events_ID anUpdateEvent = Events_Loop::eventByName(EVENT_OBJECT_UPDATED);
+ //static Events_ID aDispEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
+ static Events_ID aCreateEvent = aLoop->eventByName(EVENT_OBJECT_CREATED);
+ static Events_ID anUpdateEvent = aLoop->eventByName(EVENT_OBJECT_UPDATED);
static Events_ID aRedispEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
- static Events_ID aDeleteEvent = Events_Loop::eventByName(EVENT_OBJECT_DELETED);
+ static Events_ID aDeleteEvent = aLoop->eventByName(EVENT_OBJECT_DELETED);
static Events_ID aToHideEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
bool isActive = aLoop->activateFlushes(false);
if (aLabIter.More()) {
TDF_Label anArgLab = aLabIter.Value();
Handle(TDataStd_Comment) aGroup;
- if (aLabIter.Value().FindAttribute(TDataStd_Comment::GetID(), aGroup)) {
+ if (anArgLab.FindAttribute(TDataStd_Comment::GetID(), aGroup)) {
return TCollection_AsciiString(aGroup->Get()).ToCString();
}
}
if (aGroup->Get() == ModelAPI_ResultBody::group().c_str()) {
aNewBody = createBody(theFeature->data(), aResIndex);
} else if (aGroup->Get() == ModelAPI_ResultPart::group().c_str()) {
- if (aResIndex <= theFeature->results().size()) { // to avoid crash if previous execute
+ if (aResIndex <= (int)theFeature->results().size()) { // to avoid crash if previous execute
// for index = 0 erases result
std::shared_ptr<ModelAPI_ResultPart> aNewP = createPart(theFeature->data(), aResIndex);
if (!aNewP->data()->isDeleted()) {
Standard_Integer HashCode(const TDF_Label& theLab, const Standard_Integer theUpper)
{
return TDF_LabelMapHasher::HashCode(theLab, theUpper);
-
}
Standard_Boolean IsEqual(const TDF_Label& theLab1, const TDF_Label& theLab2)
{
#include <set>
#include <vector>
-// for TDF_Label map usage
-static Standard_Integer HashCode(const TDF_Label& theLab, const Standard_Integer theUpper);
-static Standard_Boolean IsEqual(const TDF_Label& theLab1, const TDF_Label& theLab2);
-
extern int kUNDEFINED_FEATURE_INDEX;
/**\class Model_Objects
DocumentPtr owner() {return myDoc;}
//! Deletes all managed features with emitting of corresponded signal
- ~Model_Objects();
+ virtual ~Model_Objects();
protected:
aBuilder.Generated(theShape);
theDocument->addNamingName(theShapeLabel, theName);
// set new faces to the labels
- int aCurrentTag = 1;
NCollection_List<TopoDS_Face>::Iterator anUnordered(theUnorderedFaces);
for (int aCurrentTag = 1; !theFacesOrder.IsEmpty() || anUnordered.More(); aCurrentTag++) {
TopoDS_Face aFaceToPut;
{
// Update Array of steps
int aNbSteps = stepsSize();
- if (mySteps.size() != aNbSteps) {
- while(mySteps.size() > aNbSteps) {
+ if ((int)mySteps.size() != aNbSteps) {
+ while((int)mySteps.size() > aNbSteps) {
//delete mySteps.back();
mySteps.pop_back();
}
- while(mySteps.size() < aNbSteps) {
+ while((int)mySteps.size() < aNbSteps) {
mySteps.push_back(FieldStepPtr(new Model_ResultField::Model_FieldStep(this,
- int(mySteps.size()))));
+ (int)mySteps.size())));
}
}
}
// LCOV_EXCL_START
std::shared_ptr<ModelAPI_ResultField::ModelAPI_FieldStep> Model_ResultField::step(int theId) const
{
- if (theId < mySteps.size()) {
+ if (theId < (int)mySteps.size()) {
return mySteps[theId];
}
return NULL;
std::shared_ptr<Model_Document> aDoc = std::dynamic_pointer_cast<Model_Document>(partDoc());
if (!aDoc.get()) // the part document is not presented for the moment
return "";
- TDF_Label anAccessLabel = aDoc->generalLabel();
+ MAYBE_UNUSED TDF_Label anAccessLabel = aDoc->generalLabel();
// make the selection attribute anyway:
// otherwise just by name it is not stable to search the result
std::string aName;
void Model_Update::processEvent(const std::shared_ptr<Events_Message>& theMessage)
{
static Events_Loop* aLoop = Events_Loop::loop();
- static ModelAPI_ValidatorsFactory* aFactory = ModelAPI_Session::get()->validators();
+ //static ModelAPI_ValidatorsFactory* aFactory = ModelAPI_Session::get()->validators();
static const Events_ID kCreatedEvent = aLoop->eventByName(EVENT_OBJECT_CREATED);
static const Events_ID kUpdatedEvent = aLoop->eventByName(EVENT_OBJECT_UPDATED);
static const Events_ID kOpFinishEvent = aLoop->eventByName("FinishOperation");
}
}
processFeatures();
- myIsPreviewBlocked = myIsPreviewBlocked;
+ myIsPreviewBlocked = aPreviewBlockedState;
}
}
class ModelAPI_ResultParameter;
class GeomAPI_Pnt2d;
+#if defined __GNUC__ || defined __clang__
+#define MAYBE_UNUSED __attribute__((unused))
+#else
+#define MAYBE_UNUSED
+#endif
+
/// Event ID that feature is created (comes with ModelAPI_ObjectUpdatedMessage)
-static const char * EVENT_OBJECT_CREATED = "ObjectCreated";
+MAYBE_UNUSED static const char * EVENT_OBJECT_CREATED = "ObjectCreated";
/// Event ID that data of feature is updated (comes with Model_ObjectUpdatedMessage)
-static const char * EVENT_OBJECT_UPDATED = "ObjectUpdated";
+MAYBE_UNUSED static const char * EVENT_OBJECT_UPDATED = "ObjectUpdated";
/// Event ID that data of feature is deleted (comes with Model_ObjectDeletedMessage)
-static const char * EVENT_OBJECT_DELETED = "ObjectDeleted";
+MAYBE_UNUSED static const char * EVENT_OBJECT_DELETED = "ObjectDeleted";
/// Event ID that name of feature is changed (comes with Model_ObjectRenamedMessage)
-static const char * EVENT_OBJECT_RENAMED = "ObjectRenamed";
+MAYBE_UNUSED static const char * EVENT_OBJECT_RENAMED = "ObjectRenamed";
/// Event ID that data of feature is updated (comes with ModelAPI_ObjectUpdatedMessage)
-static const char * EVENT_OBJECT_MOVED = "ObjectsMoved";
+MAYBE_UNUSED static const char * EVENT_OBJECT_MOVED = "ObjectsMoved";
/// Event ID that visualization must be redisplayed (comes with ModelAPI_ObjectUpdatedMessage)
-static const char * EVENT_OBJECT_TO_REDISPLAY = "ObjectsToRedisplay";
+MAYBE_UNUSED static const char * EVENT_OBJECT_TO_REDISPLAY = "ObjectsToRedisplay";
/// Event ID that plugin is loaded (comes with ModelAPI_ObjectUpdatedMessage)
-static const char * EVENT_PLUGIN_LOADED = "PluginLoaded";
+MAYBE_UNUSED static const char * EVENT_PLUGIN_LOADED = "PluginLoaded";
/// The active document becomes another one
-static const char * EVENT_DOCUMENT_CHANGED = "CurrentDocumentChanged";
+MAYBE_UNUSED static const char * EVENT_DOCUMENT_CHANGED = "CurrentDocumentChanged";
/// Event ID that order of objects in group is changed,
/// so, tree must be fully recreated (movement of feature)
-static const char * EVENT_ORDER_UPDATED = "OrderUpdated";
+MAYBE_UNUSED static const char * EVENT_ORDER_UPDATED = "OrderUpdated";
/// Event ID that the sketch is prepared and all grouped messages for the solver may be flushed
-static const char * EVENT_UPDATE_SELECTION = "UpdateSelection";
+MAYBE_UNUSED static const char * EVENT_UPDATE_SELECTION = "UpdateSelection";
/// Request for the enabled/disabled actions behavior for some specific features
-static const char * EVENT_FEATURE_STATE_REQUEST = "FeatureStateRequest";
+MAYBE_UNUSED static const char * EVENT_FEATURE_STATE_REQUEST = "FeatureStateRequest";
/// Reply for the enabled/disabled actions behavior for some specific features
-static const char * EVENT_FEATURE_STATE_RESPONSE = "FeatureStateResponse";
+MAYBE_UNUSED static const char * EVENT_FEATURE_STATE_RESPONSE = "FeatureStateResponse";
/// To block the viewer updates
-static const char * EVENT_UPDATE_VIEWER_BLOCKED = "UpdateViewerBlocked";
+MAYBE_UNUSED static const char * EVENT_UPDATE_VIEWER_BLOCKED = "UpdateViewerBlocked";
/// To unblock the viewer updates
-static const char * EVENT_UPDATE_VIEWER_UNBLOCKED = "UpdateViewerUnblocked";
+MAYBE_UNUSED static const char * EVENT_UPDATE_VIEWER_UNBLOCKED = "UpdateViewerUnblocked";
/// To inform that there is an empty presentation in the viewer
-static const char * EVENT_EMPTY_AIS_PRESENTATION = "EmptyAISPresentation";
+MAYBE_UNUSED static const char * EVENT_EMPTY_AIS_PRESENTATION = "EmptyAISPresentation";
/// To inform that there is an empty operation for presentation in the viewer
-static const char * EVENT_EMPTY_OPERATION_PRESENTATION = "EmptyOperationPresentation";
+MAYBE_UNUSED static const char * EVENT_EMPTY_OPERATION_PRESENTATION = "EmptyOperationPresentation";
/// To block preview
-static const char * EVENT_PREVIEW_BLOCKED = "PreviewBlocked";
+MAYBE_UNUSED static const char * EVENT_PREVIEW_BLOCKED = "PreviewBlocked";
/// To preview the current feature in the viewer (to compute the result)
-static const char * EVENT_PREVIEW_REQUESTED = "PreviewRequested";
+MAYBE_UNUSED static const char * EVENT_PREVIEW_REQUESTED = "PreviewRequested";
/// To block automatic recomputation of any feature (by the GUI button press)
-static const char * EVENT_AUTOMATIC_RECOMPUTATION_DISABLE = "DisableAutomaticRecomputation";
+MAYBE_UNUSED static const char * EVENT_AUTOMATIC_RECOMPUTATION_DISABLE = "DisableAutomaticRecomputation";
/// To unblock block automatic recomputation (default state: the GUI button unpressed)
-static const char * EVENT_AUTOMATIC_RECOMPUTATION_ENABLE = "EnableAutomaticRecomputation";
+MAYBE_UNUSED static const char * EVENT_AUTOMATIC_RECOMPUTATION_ENABLE = "EnableAutomaticRecomputation";
/// Event ID that solver has conflicting constraints (comes with ModelAPI_SolverFailedMessage)
-static const char * EVENT_SOLVER_FAILED = "SolverFailed";
+MAYBE_UNUSED static const char * EVENT_SOLVER_FAILED = "SolverFailed";
/// Event ID that the problem in solver disappeared
-static const char * EVENT_SOLVER_REPAIRED = "SolverRepaired";
+MAYBE_UNUSED static const char * EVENT_SOLVER_REPAIRED = "SolverRepaired";
/// Event Id that sketch has DoF = 0
-static const char * EVENT_SKETCH_FULLY_CONSTRAINED = "SketchFullyConstrainted";
+MAYBE_UNUSED static const char * EVENT_SKETCH_FULLY_CONSTRAINED = "SketchFullyConstrainted";
/// Event Id that sketch has DoF > 0
-static const char * EVENT_SKETCH_UNDER_CONSTRAINED = "SketchUnderConstrainted";
+MAYBE_UNUSED static const char * EVENT_SKETCH_UNDER_CONSTRAINED = "SketchUnderConstrainted";
/// Event Id that sketch has DoF < 0
-static const char * EVENT_SKETCH_OVER_CONSTRAINED = "SketchOverConstrainted";
+MAYBE_UNUSED static const char * EVENT_SKETCH_OVER_CONSTRAINED = "SketchOverConstrainted";
/// Event ID that informs that some object has changed the stability
-static const char * EVENT_STABILITY_CHANGED = "StabilityChanged";
+MAYBE_UNUSED static const char * EVENT_STABILITY_CHANGED = "StabilityChanged";
/// Event ID that the sketch is prepared and all grouped messages for the solver may be flushed
-static const char * EVENT_SKETCH_PREPARED = "SketchPrepared";
+MAYBE_UNUSED static const char * EVENT_SKETCH_PREPARED = "SketchPrepared";
/// Event ID that provides a request for list of non-fixed objects necessary for DoF = 0
-static const char * EVENT_GET_DOF_OBJECTS = "GetDoFObjects";
+MAYBE_UNUSED static const char * EVENT_GET_DOF_OBJECTS = "GetDoFObjects";
/// Event ID that provides a request for list of non-fixed objects necessary for DoF = 0
-static const char * EVENT_DOF_OBJECTS = "DoFObjects";
+MAYBE_UNUSED static const char * EVENT_DOF_OBJECTS = "DoFObjects";
/// Event ID that requests updates visual attributes for presentations
-static const char * EVENT_VISUAL_ATTRIBUTES = "UpdateVisualAttributes";
+MAYBE_UNUSED static const char * EVENT_VISUAL_ATTRIBUTES = "UpdateVisualAttributes";
+
/// Message that feature was changed (used for Object Browser update): moved, updated and deleted
class MODELAPI_EXPORT ModelAPI_ObjectUpdatedMessage : public Events_MessageGroup
class MODELAPI_EXPORT ModelAPI_EventCreator
{
public:
+ virtual ~ModelAPI_EventCreator() {}
+
/// creates created, updated or moved messages and sends to the loop
virtual void sendUpdated(const ObjectPtr& theObject, const Events_ID& theEvent,
const bool isGroupped = true) const = 0;
//! over this feature.
class ModelAPI_FeatureCopyInterface {
public:
+ virtual ~ModelAPI_FeatureCopyInterface() {}
+
/// An algorithm to update the moved feature by the separate Copy feature
/// \param theContext the original context object
/// \param theValue the original shape
class ModelAPI_FiltersFactory
{
public:
+ virtual ~ModelAPI_FiltersFactory() {}
+
/// Register an instance of a filter
/// \param theID unique identifier of the filter, not necessary equal to the name of filter
/// \param theFilter the filter's instance
class MODELAPI_EXPORT ModelAPI_ValidatorsFactory
{
public:
+ virtual ~ModelAPI_ValidatorsFactory() {}
+
/// Registers the instance of the validator by the ID
virtual void registerValidator(const std::string& theID, ModelAPI_Validator* theValidator) = 0;
{
std::string aValueStr;
char aBuf[50];
- int n = sprintf(aBuf, "%g", theValue);
+ sprintf(aBuf, "%g", theValue);
aValueStr = std::string(aBuf);
return aValueStr;
}
bool isFeatureDefaultName = myNames[theFeature].myIsDefault;
// Save only names of results which is not correspond to default feature name
- const std::list<ResultPtr>& aResults = theFeature->results();
std::list<ResultPtr> allRes;
ModelAPI_Tools::allResults(theFeature, allRes);
for(std::list<ResultPtr>::iterator aRes = allRes.begin(); aRes != allRes.end(); aRes++) {
exportVariable(anEntry, aNameIter->second.myCurrentName);
size_t aSize = aFeature->results().size();
if (aSize > 1) { // additional entries for features with more than one result
- for(int a = 1; a < aSize; a++) {
+ for(size_t a = 1; a < aSize; a++) {
std::ostringstream aResEntryStr;
aResEntryStr<<anEntry<<":"<<a;
std::string aResEntry = aResEntryStr.str();
MODELHIGHAPI_EXPORT DumpStorage(const DumpStorage& theOther);
MODELHIGHAPI_EXPORT const DumpStorage& operator=(const DumpStorage& theOther);
+ virtual ~DumpStorage() {}
+
void setFilenameSuffix(const std::string& theSuffix) { myFilenameSuffix = theSuffix; }
protected:
theAttribute->selectSubShape(
myWeakNamingPair.first, myWeakNamingPair.second.first, myWeakNamingPair.second.second);
break;
+ case VT_Filtering:
+ break; // do nothing [to avoid compilation warning]
}
if (theAttribute->isInvalid()) {
myResultSubShapePair.first->shape()->shapeTypeStr();
case VT_TypeSubShapeNamePair: return myTypeSubShapeNamePair.first;
case VT_TypeInnerPointPair: return myTypeInnerPointPair.first;
+ default:
+ break; // do nothing [to avoid compilation warning]
}
return "SHAPE";
aShapeType = shapeTypeByStr(aType);
break;
}
+ default:
+ break; // do nothing [to avoid compilation warning]
}
return aShapeType;
}
}
// store the model features information: iterate all features
- int anObjectsCount = 0; // stores the number of compared features for this document to compare
+ size_t anObjectsCount = 0; // stores the number of compared features for this document to compare
std::set<std::string> aProcessed; // processed features names (that are in the current document)
// process all objects (features and folders)
ModuleBase_ModelWidget* aWgt;
QList<ModuleBase_ModelWidget*>::const_iterator aWIt;
- bool isOffToolBox = false;
for (aWIt = theWidgets.begin(); aWIt != theWidgets.end() && !aFirstWidget; ++aWIt) {
aWgt = (*aWIt);
if (!aValidators->isCase(aWgt->feature(), aWgt->attributeID()))
/// A selection can be obtained as from a viewer as from Object browser in various forms
class MODULEBASE_EXPORT ModuleBase_ISelection
{
- public:
- /// Types of the selection place, where the selection is obtained
- enum SelectionPlace { Browser, Viewer, AllControls };
+public:
+ /// Types of the selection place, where the selection is obtained
+ enum SelectionPlace { Browser, Viewer, AllControls };
+
+ virtual ~ModuleBase_ISelection() {}
/// Returns a list of viewer selected presentations
/// \return list of presentations
ModuleBase_ISelectionActivate(ModuleBase_IWorkshop* theWorkshop) : myWorkshop(theWorkshop) {}
/// Destructor
- ~ModuleBase_ISelectionActivate() {}
+ virtual ~ModuleBase_ISelectionActivate() {}
/// Updates active selection modes in the viewer depending on the application state
MODULEBASE_EXPORT virtual void updateSelectionModes() = 0;
class MODULEBASE_EXPORT ModuleBase_IconFactory
{
public:
+ virtual ~ModuleBase_IconFactory() {}
+
/// Returns icons factory instance
static ModuleBase_IconFactory* get();
ModuleBase_LabelValue::ModuleBase_LabelValue(QWidget* theParent, const QString& theText,
const QString& theToolTip, const QString& theIcon,
int thePrecision)
-: QWidget(theParent), myPrecision(thePrecision), myValue(0)
+: QWidget(theParent), myValue(0), myPrecision(thePrecision)
{
QHBoxLayout* aLayout = new QHBoxLayout(this);
aLayout->setContentsMargins(2, 0, 0, 0);
ModuleBase_ModelWidget::ModuleBase_ModelWidget(QWidget* theParent,
const Config_WidgetAPI* theData)
: QWidget(theParent),
+ myWidgetValidator(0),
myIsEditing(false),
myState(Stored),
myIsValueStateBlocked(false),
- myFlushUpdateBlocked(false),
- myWidgetValidator(0)
+ myFlushUpdateBlocked(false)
{
#ifdef DEBUG_WIDGET_INSTANCE
qDebug("ModuleBase_ModelWidget::ModuleBase_ModelWidget");
}
}
else {
- bool isSet = false;
// 1. apply the selection to controls
for (aWIt = aWidgets.constBegin(); aWIt != aWidgets.constEnd(); ++aWIt) {
aWgt = (*aWIt);
if (!aWgt->canAcceptFocus())
continue;
aPropertyPanel->setPreselectionWidget(aWgt);
- if (myPreSelection.empty() || !aWgt->setSelection(myPreSelection, true)) {
- isSet = false;
+ if (myPreSelection.empty() || !aWgt->setSelection(myPreSelection, true))
break;
- } else {
- isSet = true;
+ else
aFilledWgt = aWgt;
- }
}
}
aPropertyPanel->setPreselectionWidget(NULL);
ModuleBase_PagedContainer::ModuleBase_PagedContainer(QWidget* theParent,
const Config_WidgetAPI* theData)
: ModuleBase_ModelWidget(theParent, theData),
- myIsFocusOnCurrentPage(false), myIsFirst(true), myRemeberChoice(true)
+ myRemeberChoice(true), myIsFocusOnCurrentPage(false), myIsFirst(true)
{
// it is not obligatory to be ignored when property panel tries to activate next active widget
// but if focus is moved to this control, it can accept it.
: QAbstractSpinBox(theParent),
myIsEquation(false),
myAcceptVariables(true),
- mySingleStep(1),
myMinimum(-DBL_MAX),
- myMaximum(DBL_MAX)
+ myMaximum(DBL_MAX),
+ mySingleStep(1)
{
myCompleter = new QCompleter(this);
myCompleter->setWidget(lineEdit());
void ModuleBase_Preferences::createCustomPage(ModuleBase_IPrefMgr* thePref, int thePageId)
{
SUIT_ResourceMgr* aResMgr = ModuleBase_Preferences::resourceMgr();
- bool isResModified = false;
// Make a Tab from each section
std::list<std::string> aSections = Config_PropManager::getSections();
// check that the property is defined
QString aSection(aProp->section().c_str());
QString aName(aProp->name().c_str());
- if (!aResMgr->hasValue(aSection, aName)) {
+ if (!aResMgr->hasValue(aSection, aName))
aResMgr->setValue(aSection, aName, QString(aProp->value().c_str()));
- isResModified = true;
- }
+
// Add item
if (aProp->type() != Config_Prop::Disabled) {
SUIT_PreferenceMgr::PrefItemType aPrefType = SUIT_PreferenceMgr::Auto;
thePref->setItemProperty("icons", aIconsList, anId);
}
break;
+ default: // [to avoid compilation warnings]
+ break;
}
}
}
//********************************************************************
ModuleBase_ResultPrs::ModuleBase_ResultPrs(ResultPtr theResult)
- : ViewerData_AISShape(TopoDS_Shape()), myResult(theResult), myAdditionalSelectionPriority(0),
- myTransparency(1), myIsSubstituted(false)
+ : ViewerData_AISShape(TopoDS_Shape()),
+ myResult(theResult),
+ myIsSubstituted(false),
+ myTransparency(1),
+ myAdditionalSelectionPriority(0)
{
GeomShapePtr aShapePtr = ModelAPI_Tools::shape(theResult);
//********************************************************************
void ModuleBase_ResultPrs::setSubShapeHidden(const TopoDS_ListOfShape& theShapes)
{
- bool isModified = false;
-
TopoDS_Compound aCompound;
BRep_Builder aBBuilder;
aBBuilder.MakeCompound (aCompound);
while (aParent) {
QStackedWidget* aStackedWidget = dynamic_cast<QStackedWidget*>(aParent);
if (aStackedWidget) {
- int anIndex = aStackedWidget->currentIndex();
isOffToolBox = aStackedWidget->currentWidget() != aWidget;
break;
}
aPartFeatureNames.sort();
anOtherFeatureNames.sort();
- bool aCanReplaceParameters = !aFeaturesRefsToParameterOnly.empty();
-
QMessageBox aMessageBox(theParent);
aMessageBox.setWindowTitle(QObject::tr("Delete features"));
aMessageBox.setIcon(QMessageBox::Warning);
"be deleted.\nOr parameters could be replaced by their values.\n";
aText += QString(QObject::tr(aMsg))
.arg(aParamFeatureNames.join(aSep));
+#ifdef _DEBUG
QPushButton *aReplaceButton =
+#endif
aMessageBox.addButton(QObject::tr("Replace"), QMessageBox::ActionRole);
}
{
std::string aName;
if (theAttribute.get() != NULL) {
- ModuleBase_Operation* anOperation = theWorkshop->currentOperation();
-
FeaturePtr aFeature = ModelAPI_Feature::feature(theAttribute->owner());
if (aFeature.get()) {
std::string aXmlCfg, aDescription;
case Prs3d_DP_ZAxis:
aDir = anAxis.Direction();
break;
+ default: // [to avoid compilation warning]
+ break;
}
gp_Lin aLine(aTrihedron->Component()->Location(), aDir);
return aPlane.Contains(aLine, Precision::Confusion(), Precision::Angular());
const GeomShapePtr& theShape,
Handle(SelectMgr_EntityOwner) theOwner)
: myResult(theResult),
- myShape(theShape),
- myOwner(theOwner)
+ myOwner(theOwner),
+ myShape(theShape)
{
}
DataPtr aData = myFeature->data();
AttributeRefListPtr anAttributeList = aData->reflist(attributeID());
anAttributeList->clear();
- int aSize1 = anAttributeList->size(false);
for (int i = 0, aSize = myView->rowCount(); i < aSize; i++) {
QCheckBox* aButton =
dynamic_cast<QCheckBox*>(myView->cellWidget(i, 0)->findChild<QCheckBox*>());
if (aButton->isChecked())
anAttributeList->append(myConcealedResults[i]);
}
- int aSize = anAttributeList->size(false);
return true;
}
DataPtr aData = myFeature->data();
AttributeRefListPtr anAttributeList = aData->reflist(attributeID());
- int aSize = anAttributeList->size();
for (int i = 0, aSize = myView->rowCount(); i < aSize; i++) {
ResultPtr aResult = myConcealedResults[i];
QCheckBox* aButton =
//********************************************************************
bool ModuleBase_WidgetFeatureSelector::setSelectionCustom(const ModuleBase_ViewerPrsPtr& thePrs)
{
- ModuleBase_ISelection* aSelection = myWorkshop->selection();
ObjectPtr anObject = ModelAPI_Feature::feature(thePrs->object());
GeomShapePtr aShape;
std::wstring aWStr((wchar_t*)aStr);
static const int aBufSize = 1000;
static char aMBStr[aBufSize];
- size_t aLen = wcstombs(aMBStr, aWStr.c_str(), aBufSize);
+#ifdef _DEBUG
+ size_t aLen =
+#endif
+ wcstombs(aMBStr, aWStr.c_str(), aBufSize);
std::string aCodec = Config_Translator::codec("");
aText = QTextCodec::codecForName(aCodec.c_str())->toUnicode(aMBStr);
} else {
i--;
}
break;
+ default: // [to avoid compilation warning]
+ break;
}
}
return aList;
myGroupBox(0),
myGroupBoxLayout(0),
myCheckGroup(0),
- myCheckGroupLayout(0),
- myCheckContent(0),
myCheckGroupBtn(0),
+ myCheckContent(0),
+ myCheckGroupLayout(0),
myEnableOnCheck(true)
{
myToolTip = theData->widgetTooltip();
const QPixmap& theIcon,
const QString& theTooltip)
{
+#ifdef _DEBUG
int aSuperCount =
+#endif
ModuleBase_PagedContainer::addPage(thePage, theName, theCaseId, theIcon, theTooltip);
myCombo->addItem(translate(theName.toStdString()));
int aResultCount = myCombo->count();
//********************************************************************
bool ModuleBase_WidgetValidated::isFilterActivated() const
{
- bool isActivated = false;
-
Handle(SelectMgr_Filter) aSelFilter = myWorkshop->validatorFilter();
ModuleBase_IViewer* aViewer = myWorkshop->viewer();
ModuleBase_WidgetValidator::ModuleBase_WidgetValidator(ModuleBase_ModelWidget* theModelWidget,
ModuleBase_IWorkshop* theWorkshop)
-: myModelWidget(theModelWidget), myWorkshop(theWorkshop), myIsInValidate(false)
+ : myIsInValidate(false), myModelWidget(theModelWidget), myWorkshop(theWorkshop)
{
myAttributeStore = new ModuleBase_WidgetSelectorStore();
}
bool ModuleBase_WidgetValidator::isFilterActivated() const
{
- bool isActivated = false;
-
Handle(SelectMgr_Filter) aSelFilter = myWorkshop->validatorFilter();
ModuleBase_IViewer* aViewer = myWorkshop->viewer();
return sstream.str() + aPnt;
}
-static std::set<std::string> toSet(const std::list<std::string>& theContainer)
-{
- return std::set<std::string>(theContainer.begin(), theContainer.end());
-}
-
//------------------------------------------------------------------------------
ParametersPlugin_EvalListener::ParametersPlugin_EvalListener()
ModelAPI_ReplaceParameterMessage::eventId()
};
- for (int i = 0; i < sizeof(anEvents_IDs)/sizeof(anEvents_IDs[0]); ++i)
+ for (unsigned long long i = 0; i < sizeof(anEvents_IDs)/sizeof(anEvents_IDs[0]); ++i)
aLoop->registerListener(this, anEvents_IDs[i], NULL, true);
}
theError = aProcessMessage->error();
// compare the list of parameters to store if changed
AttributeRefListPtr aParams = reflist(ARGUMENTS_ID());
- bool aDifferent = aParams->size() != aParamsList.size();
+ bool aDifferent = aParams->size() != (int)aParamsList.size();
if (!aDifferent) {
std::list<ResultParameterPtr>::const_iterator aNewIter = aParamsList.begin();
std::list<ObjectPtr> anOldList = aParams->list();
aData->attribute(SketchPlugin_BSpline::POLES_ID()));
AttributeDoubleArrayPtr aWeights = aData->realArray(SketchPlugin_BSpline::WEIGHTS_ID());
- while (myPoles.size() < aPoles->size())
+ while ((int)myPoles.size() < aPoles->size())
addPoleWidget();
std::list<BSplinePoleWidgets>::iterator anIt = myPoles.begin();
Quantity_Color getShapeColor(const ModuleBase_IModule::ModuleBase_CustomizeFlag& theFlag);
private:
- bool myPresentationIsEmpty; /// Boolean state about empty presentation
- FeaturePtr myFeature; /// Reference to a feature object
ModuleBase_IWorkshop* myWorkshop; /// current workshop
+ FeaturePtr myFeature; /// Reference to a feature object
+ bool myPresentationIsEmpty; /// Boolean state about empty presentation
/// map of presentation type to AIS object
QMap<ModuleBase_IModule::ModuleBase_CustomizeFlag, AISObjectPtr> myPresentations;
/// State whether the presentation is activated/deactivated
case ModelAPI_AttributeTables::INTEGER:
aFieldStepData << aVal.myInt;
break;
+ default: // [to avoid compilation warning]
+ break;
}
}
}
}
}
QList<double> aShapeData;
- double aRangeMin = aFieldStepData.first(), aRangeMax = aFieldStepData.last();
for (int aRow = 0; aRow < aRows - 1; aRow++) {
double aNorm = 0;
int aBaseIndex = aRow * aCols;
return QIcon(":icons/group_face.png");
case GeomAPI_Shape::SOLID:
return QIcon(":icons/group_solid.png");
+ default: // [to avoid compilation warning]
+ break;
}
}
ResultBodyPtr aBody = std::dynamic_pointer_cast<ModelAPI_ResultBody>(aResult);
case GeomAPI_Shape::WIRE: return QIcon(":pictures/wire.png");
case GeomAPI_Shape::EDGE: return QIcon(":pictures/edge.png");
case GeomAPI_Shape::VERTEX: return QIcon(":pictures/vertex.png");
+ default: // [to avoid compilation warning]
+ break;
}
}
}
std::shared_ptr<GeomAPI_Pnt2d> aPnt = PartSet_Tools::getCoincedencePoint(aConstrFeature);
if (aPnt.get() == NULL)
return;
- gp_Pnt aP = aPnt->impl<gp_Pnt>();
if (theRefPnt->isEqual(aPnt) && (!theOutList.contains(aConstrFeature))) {
theOutList.append(aConstrFeature);
}
if (aToDelFeatures.size() > 0) {
XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(myModule->workshop());
XGUI_Workshop* aWorkshop = aConnector->workshop();
- ModuleBase_Operation* anOperation = myModule->workshop()->currentOperation();
ModuleBase_Operation* anOpAction =
new ModuleBase_Operation(tr("Detach %1").arg(aLine->data()->name().c_str()), myModule);
- bool isSketchOp = PartSet_SketcherMgr::isSketchOperation(anOperation);
XGUI_OperationMgr* anOpMgr = aConnector->workshop()->operationMgr();
// the active nested sketch operation should be aborted unconditionally
// the Delete action should be additionally granted for the Sketch operation
XGUI_OperationMgr* anOpMgr = aConnector->workshop()->operationMgr();
if (isUseTransaction) {
anOpAction = new ModuleBase_Operation(anAction->text(), myModule);
- bool isSketchOp = PartSet_SketcherMgr::isSketchOperation(anOperation);
bool isCommitted;
if (!anOpMgr->canStartOperation(anOpAction->id(), isCommitted))
DocumentPtr aDoc = aMgr->moduleDocument();
int aNbParts = aDoc->size(ModelAPI_ResultPart::group());
- bool isActivated = false;
QList<ResultPartPtr> aPartsToLoad;
for (int i = 0; i < aNbParts; i++) {
ObjectPtr aObj = aDoc->object(ModelAPI_ResultPart::group(), i);
//******************************************************
PartSet_Module::PartSet_Module(ModuleBase_IWorkshop* theWshop)
: ModuleBase_IModule(theWshop),
+ myIsOperationIsLaunched(false),
myVisualLayerId(0),
- myRoot(0),
- myIsOperationIsLaunched(false)
+ myRoot(0)
{
new PartSet_IconFactory(this);
mySketchMgr = new PartSet_SketcherMgr(this);
mySketchReentrantMgr = new PartSet_SketcherReentrantMgr(theWshop);
- XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(theWshop);
- XGUI_Workshop* aWorkshop = aConnector->workshop();
-
ModuleBase_IViewer* aViewer = theWshop->viewer();
connect(aViewer, SIGNAL(keyRelease(ModuleBase_IViewWindow*, QKeyEvent*)),
this, SLOT(onKeyRelease(ModuleBase_IViewWindow*, QKeyEvent*)));
Config_WidgetAPI* theWidgetApi)
{
ModuleBase_IWorkshop* aWorkshop = workshop();
- XGUI_Workshop* aXUIWorkshop = getWorkshop();
ModuleBase_ModelWidget* aWgt = NULL;
if (theType == "sketch-start-label") {
PartSet_WidgetSketchLabel* aLabelWgt = new PartSet_WidgetSketchLabel(theParent, aWorkshop,
(aCurrentOperation->id() == "Measurement")))
{
double aLen = aView->Convert(SketcherPrs_Tools::getConfigArrowSize());
-
- double aPrevLen = SketcherPrs_Tools::getArrowSize();
SketcherPrs_Tools::setArrowSize(aLen);
const double aCurScale = aViewer->activeView()->Camera()->Scale();
aViewer->SetScale(aViewer->activeView(), aCurScale);
thePresentation->Clear();
bool aReadyToDisplay = !myShapeToPrsMap.IsEmpty();
- XGUI_Displayer* aDisplayer = XGUI_Tools::workshop(myWorkshop)->displayer();
Handle(Prs3d_Drawer) aDrawer = Attributes();
// create presentations on the base of the shapes
BRep_Builder aBuilder;
int aWidth = anIO->Width();
/// workaround for zero width. Else, there will be a crash
if (aWidth == 0) { // width returns of TSolid shape is zero
- bool isDisplayed = !anIO->GetContext().IsNull();
aWidth = PartSet_Tools::getAISDefaultWidth();// default width value
}
setWidth(aDrawer, aWidth);
GeomShapePtr theGeomShape,
QMap<ObjectPtr, QList<GeomShapePtr> >& theObjectShapes)
{
- XGUI_Displayer* aDisplayer = XGUI_Tools::workshop(theWorkshop)->displayer();
- // VSV: Do not use isVisible checking because it can be used when state "Show Only" is ON
+ //XGUI_Displayer* aDisplayer = XGUI_Tools::workshop(theWorkshop)->displayer();
+ //// VSV: Do not use isVisible checking because it can be used when state "Show Only" is ON
//if (XGUI_Displayer::isVisible(aDisplayer, theObject)) {
if (theGeomShape.get()) {
if (theObjectShapes.contains(theObject))
if (!theFeature.get())
return;
- XGUI_Displayer* aDisplayer = XGUI_Tools::workshop(theWorkshop)->displayer();
-
std::list<ResultPtr> aResults;
ModelAPI_Tools::allResults(theFeature, aResults);
std::list<ResultPtr>::const_iterator aRIt = aResults.begin(),
#include <Prs3d_LineAspect.hxx>
#include <Graphic3d_AspectMarker3d.hxx>
-#define DEBUG_WIRE
+//#define DEBUG_WIRE
#ifdef DEBUG_WIRE
#include <TopTools_IndexedMapOfShape.hxx>
}
PartSet_SketcherMgr::PartSet_SketcherMgr(PartSet_Module* theModule)
- : QObject(theModule), myModule(theModule), myIsEditLaunching(false), myIsDragging(false),
- myDragDone(false), myIsMouseOverWindow(false),
- myIsMouseOverViewProcessed(true), myPreviousUpdateViewerEnabled(true),
- myIsPopupMenuActive(false), myExternalPointsMgr(0), myNoDragMoving(false)
+ : QObject(theModule),
+ myModule(theModule),
+ myIsEditLaunching(false),
+ myIsDragging(false),
+ myDragDone(false),
+ myIsMouseOverWindow(false),
+ myIsMouseOverViewProcessed(true),
+ myIsPopupMenuActive(false),
+ myPreviousUpdateViewerEnabled(true),
+ myExternalPointsMgr(0),
+ myNoDragMoving(false)
{
ModuleBase_IWorkshop* anIWorkshop = myModule->workshop();
ModuleBase_IViewer* aViewer = anIWorkshop->viewer();
#endif
Handle(V3d_View) aView = theWnd->v3dView();
- gp_Pnt aPoint = PartSet_Tools::convertClickToPoint(theEvent->pos(), aView);
Point aMousePnt;
get2dPoint(theWnd, theEvent, aMousePnt);
qDebug(QString("startSketch: %1, %2").arg(anInfo.size()).arg(anInfoStr).toStdString().c_str());
#endif
- bool aHasPlane = false;
std::shared_ptr<GeomAPI_Pln> aPln;
aPln = PartSet_Tools::sketchPlane(myCurrentSketch);
Handle(SelectMgr_Filter) aFilter = myModule->selectionFilter(SF_SketchPlaneFilter);
std::string aKind = theFeature->getKind();
if (aConstrIds.contains(QString(aKind.c_str()))) {
- bool isTypedConstraint = false;
-
switch (theState) {
case PartSet_Tools::Dimensional: {
bool isDistance = isDistanceKind(aKind);
std::map<AttributePtr, int> aSelectedAttributes = anInfo.myAttributes;
std::set<ResultPtr> aSelectedResults = anInfo.myResults;
- ModuleBase_IViewer* aViewer = theWorkshop->viewer();
-
XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(theWorkshop);
XGUI_Displayer* aDisplayer = aConnector->workshop()->displayer();
// result owners are put in the list of selection only if local selected shapes were not
// found
if (aSelectedResults.find(aResult) != aSelectedResults.end()) {
- for ( Standard_Integer i = 1, n = aSelectedOwners.Extent(); i <= n; i++ ) {
+ for (Standard_Integer i = 1, n = aSelectedOwners.Extent(); i <= n; i++ ) {
Handle(StdSelect_BRepOwner) anOwner =
- Handle(StdSelect_BRepOwner)::DownCast(aSelectedOwners(i));
- if ( anOwner.IsNull() || !anOwner->HasShape() || theOwnersToSelect.FindIndex(anOwner))
+ Handle(StdSelect_BRepOwner)::DownCast(aSelectedOwners(i));
+ if (anOwner.IsNull() || !anOwner->HasShape() || theOwnersToSelect.FindIndex(anOwner))
continue;
- // select whole result
- theOwnersToSelect.Add(anOwner);
+ // select whole result
+ theOwnersToSelect.Add(anOwner);
}
}
}
ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
(getCurrentOperation());
if (aFOperation) {
- if (PartSet_SketcherMgr::isSketchOperation(aFOperation) ||
- isNestedSketchOperation(aFOperation) &&
+ if ((PartSet_SketcherMgr::isSketchOperation(aFOperation) ||
+ isNestedSketchOperation(aFOperation)) &&
thePreviousState == ModuleBase_ModelWidget::ModifiedInPP) {
FeaturePtr aFeature = aFOperation->feature();
visualizeFeature(aFeature, aFOperation->isEditOperation(), canDisplayObject(aFeature));
if (isEditOperation || !theFeature.get())
return;
- ModuleBase_IWorkshop* aWorkshop = myModule->workshop();
- XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(aWorkshop);
-
// 1. change visibility of the object itself, here the presentable object is processed,
// e.g. constraints features
//FeaturePtr aFeature = aFOperation->feature();
case PartSet_Tools::Geometrical:
case PartSet_Tools::Dimensional: {
if (aPrevState != theState) {
- ModuleBase_IWorkshop* aWorkshop = myModule->workshop();
- XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(aWorkshop);
int aNumberOfSubs = myCurrentSketch->numberOfSubs();
for (int i = 0; i < aNumberOfSubs; i++) {
FeaturePtr aSubFeature = myCurrentSketch->subFeature(i);
}
}
break;
+ default: // [to avoid compilation warning]
+ break;
}
}
std::vector<int> PartSet_SketcherMgr::colorOfObject(const ObjectPtr& theObject,
const FeaturePtr& theFeature, bool isConstruction) const
{
- static const QStringList& aConstrIds = constraintsIdList();
PartSet_OverconstraintListener* aOCListener = myModule->overconstraintListener();
std::string aKind = theFeature->getKind();
void PartSet_SketcherReentrantMgr::onAfterValuesChangedInPropertyPanel()
{
-
if (isInternalEditActive()) {
- ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
- (myWorkshop->currentOperation());
ModuleBase_ModelWidget* aWidget = (ModuleBase_ModelWidget*)sender();
if (!aWidget->isModifiedInEdit().empty())
restartOperation();
QList<ModuleBase_ModelWidget*> aWidgets = aPanel->modelWidgets();
for (int i = 0, aNb = aWidgets.size(); i < aNb && !aPreviousAttributeWidget; i++) {
if (aWidgets[i]->attributeID() == thePreviousAttributeID) {
- /// workaround for the same attributes used in different stacked widgets(attribute types)
- if (ModuleBase_ToolBox::isOffToolBoxParent(aWidgets[i]))
- continue;
+ // workaround for the same attributes used in different stacked widgets(attribute types)
+ if (ModuleBase_ToolBox::isOffToolBoxParent(aWidgets[i]))
+ continue;
aPreviousAttributeWidget = aWidgets[i];
}
}
// there is a check whether the feature contains a point and a linear edge or two point values
std::string aParamA = theArguments.front();
- SessionPtr aMgr = ModelAPI_Session::get();
- ModelAPI_ValidatorsFactory* aFactory = aMgr->validators();
FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(theAttribute->owner());
AttributeRefAttrPtr aRefAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(theAttribute);
AttributePtr aAR = aRAttr->attr();
if (aAR->id() != SketchPlugin_Arc::CENTER_ID()) // ignore constraint to center of arc
aCoinList.insert(aConstrFeature);
- QList<bool> anIsAttributes;
- PartSet_Tools::findCoincidences(aConstrFeature, aCoinsideLines, aCoins,
- SketchPlugin_ConstraintCoincidence::ENTITY_A(),
- anIsAttributes);
- PartSet_Tools::findCoincidences(aConstrFeature, aCoinsideLines, aCoins,
- SketchPlugin_ConstraintCoincidence::ENTITY_B(),
- anIsAttributes);
+ QList<bool> anIsAttributes;
+ PartSet_Tools::findCoincidences(aConstrFeature, aCoinsideLines, aCoins,
+ SketchPlugin_ConstraintCoincidence::ENTITY_A(),
+ anIsAttributes);
+ PartSet_Tools::findCoincidences(aConstrFeature, aCoinsideLines, aCoins,
+ SketchPlugin_ConstraintCoincidence::ENTITY_B(),
+ anIsAttributes);
}
}
// if there is no coincidence then it is not valid
myBox->setFlat(false);
aMainLayout->addWidget(myBox);
- bool aAcceptVariables = theData->getBooleanAttribute(DOUBLE_WDG_ACCEPT_EXPRESSIONS, true);
+#ifdef _DEBUG
+ bool aAcceptVariables =
+#endif
+ theData->getBooleanAttribute(DOUBLE_WDG_ACCEPT_EXPRESSIONS, true);
// B-spline weights attribute
myWeightsAttr = theData->getProperty("weights");
bool PartSet_WidgetBSplinePoints::isValidSelectionCustom(const ModuleBase_ViewerPrsPtr& theValue)
{
- bool aValid = true;
-
PartSet_Module* aModule = dynamic_cast<PartSet_Module*>(myWorkshop->module());
if (aModule->sketchReentranceMgr()->isInternalEditActive())
return true; // when internal edit is started a new feature is created. I has not results, AIS
AttributeDoubleArrayPtr aWeightsArray = aData->realArray(myWeightsAttr);
if (aPointArray->isInitialized()) {
- while (myXSpin.size() < aPointArray->size())
+ while ((int)myXSpin.size() < aPointArray->size())
createNextPoint();
std::vector<ModuleBase_LabelValue*>::iterator aXIt = myXSpin.begin();
myGroupBox = new QGroupBox(aPageName, theParent);
myGroupBox->setFlat(false);
- bool aAcceptVariables = theData->getBooleanAttribute(DOUBLE_WDG_ACCEPT_EXPRESSIONS, true);
+#ifdef _DEBUG
+ bool aAcceptVariables =
+#endif
+ theData->getBooleanAttribute(DOUBLE_WDG_ACCEPT_EXPRESSIONS, true);
QGridLayout* aGroupLay = new QGridLayout(myGroupBox);
ModuleBase_Tools::adjustMargins(aGroupLay);
aGroupLay->setSpacing(2);
aGroupLay->setColumnStretch(1, 1);
- {
- QLabel* aLabel = new QLabel(myGroupBox);
-
- myXSpin = new ModuleBase_LabelValue(myGroupBox, tr("X"));
- //ModuleBase_ParamSpinBox(myGroupBox);
- //myXSpin->setAcceptVariables(aAcceptVariables);
- //myXSpin->setMinimum(-DBL_MAX);
- //myXSpin->setMaximum(DBL_MAX);
- //myXSpin->setToolTip(tr("X"));
- aGroupLay->addWidget(myXSpin, 0, 1);
-
- //connect(myXSpin, SIGNAL(textChanged(const QString&)), this, SIGNAL(valuesModified()));
- //myXSpin->setValueEnabled(isValueEnabled());
- }
- {
- //QLabel* aLabel = new QLabel(myGroupBox);
- //aLabel->setText(tr("Y "));
- //aGroupLay->addWidget(aLabel, 1, 0);
-
- myYSpin = new ModuleBase_LabelValue(myGroupBox, tr("Y"));
- //ModuleBase_ParamSpinBox(myGroupBox);
- //myYSpin = new ModuleBase_ParamSpinBox(myGroupBox);
- //myYSpin->setAcceptVariables(aAcceptVariables);
- //myYSpin->setMinimum(-DBL_MAX);
- //myYSpin->setMaximum(DBL_MAX);
- //myYSpin->setToolTip(tr("Y"));
- aGroupLay->addWidget(myYSpin, 1, 1);
-
- //connect(myYSpin, SIGNAL(textChanged(const QString&)), this, SIGNAL(valuesModified()));
- //myYSpin->setValueEnabled(isValueEnabled());
- }
+
+ myXSpin = new ModuleBase_LabelValue(myGroupBox, tr("X"));
+ aGroupLay->addWidget(myXSpin, 0, 1);
+ myYSpin = new ModuleBase_LabelValue(myGroupBox, tr("Y"));
+ aGroupLay->addWidget(myYSpin, 1, 1);
+
QVBoxLayout* aLayout = new QVBoxLayout(this);
ModuleBase_Tools::zeroMargins(aLayout);
aLayout->addWidget(myGroupBox);
bool PartSet_WidgetPoint2D::isValidSelectionCustom(const ModuleBase_ViewerPrsPtr& theValue)
{
- bool aValid = true;
-
PartSet_Module* aModule = dynamic_cast<PartSet_Module*>(myWorkshop->module());
if (aModule->sketchReentranceMgr()->isInternalEditActive())
return true; /// when internal edit is started a new feature is created. I has not results, AIS
}
}
if (!anExternal) {
- bool isProcessed = false;
GeomPnt2dPtr aPnt = PartSet_Tools::getPnt2d(aView, aShape, mySketch);
if (aPnt && isFeatureContainsPoint(myFeature, aPnt->x(), aPnt->y())) {
// when the point is selected, the coordinates of the point should be set into the attribute
bool PartSet_WidgetSketchCreator::hasSubObjects() const
{
bool aHasSubObjects = false;
-
- bool aCanSetFocus = true;
CompositeFeaturePtr aComposite = std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(myFeature);
if (aComposite.get())
aHasSubObjects = aComposite->numberOfSubs() > 0;
}
// manually deactivation because the widget was not activated as has no focus acceptin controls
deactivate();
- bool aHidePreview = myPreviewPlanes->isPreviewDisplayed();
myPreviewPlanes->erasePreviewPlanes(myWorkshop);
// start edit operation for the sketch
if (aModule)
aModule->onViewTransformed();
- // 6. Update sketcher actions
- XGUI_ActionsMgr* anActMgr = aWorkshop->actionsMgr();
-
myWorkshop->updateCommandStatus();
aWorkshop->selector()->clearSelection();
myWorkshop->viewer()->update();
theBoxAlgo->prepareNamingFaces();
// Insert to faces
- int num = 1;
std::map< std::string, std::shared_ptr<GeomAPI_Shape> > listOfFaces =
theBoxAlgo->getCreatedFaces();
for (std::map< std::string, std::shared_ptr<GeomAPI_Shape> >::iterator it = listOfFaces.begin();
// Insert to faces
// Naming for faces
- int num = 1;
std::map< std::string, std::shared_ptr<GeomAPI_Shape> > listOfFaces =
theTorusAlgo->getCreatedFaces();
for (std::map< std::string, std::shared_ptr<GeomAPI_Shape> >::iterator it = listOfFaces.begin();
QString aToolName = tr("Inspection");
int aTool = createTool(aToolName);
- int aToolId = createTool(myWhatIsAction, aTool);
+#ifdef _DEBUG
+ int aToolId =
+#endif
+ createTool(myWhatIsAction, aTool);
registerCommandToolbar(aToolName, aId);
// Define Edit toolbars command
aId = getNextCommandId();
//myActionsList.append(aId); Do not use it for editing of toolbars
aTip = tr("Edit toolbars of the module");
- QAction* aAction = createAction(aId, aTip, QIcon(":pictures/configure_toolbars.png"),
+#ifdef _DEBUG
+ QAction* aAction =
+#endif
+ createAction(aId, aTip, QIcon(":pictures/configure_toolbars.png"),
tr("Edit toolbars..."), aTip, QKeySequence(), aDesk, false, this, SLOT(onEditToolbars()));
int aEditMenu = createMenu(tr("MEN_DESK_EDIT"), -1, -1, 30);
- int aEditItem = createMenu(aId, aEditMenu);
+#ifdef _DEBUG
+ int aEditItem =
+#endif
+ createMenu(aId, aEditMenu);
// Initialize viewer proxy if OCC viewer is already exist
ViewManagerList aOCCViewManagers;
aAction->setData(theId);
int aWBMenu = createMenu(theWBName, -1, -1, 30/*10-Window, 1000 - Help*/);
- int aItemId = createMenu(aId, aWBMenu);
+#ifdef _DEBUG
+ int aItemId =
+#endif
+ createMenu(aId, aWBMenu);
if (isAddSeparator)
createMenu(separator(), aWBMenu);
int aWBTool = createTool(theTBName, theTBName);
- int aToolId = createTool(aId, aWBTool);
+#ifdef _DEBUG
+ int aToolId =
+#endif
+ createTool(aId, aWBTool);
registerCommandToolbar(theTBName, aId);
if (isAddSeparator) {
createTool(separator(), aWBTool);
createMenu(separator(), aWBMenu); /// nested action is always separated of others
int aWBTool = createTool(theWBName, theWBName);
- int aToolId = createTool(anAction, aWBTool);
+#ifdef _DEBUG
+ int aToolId =
+#endif
+ createTool(anAction, aWBTool);
registerCommandToolbar(theWBName, aItemId);
createTool(separator(), aWBTool); /// nested action is always separated of others
registerCommandToolbar(theWBName, -1);
return;
// Save toolbars configuration into map
QMap<QString, QStringList> aToolbarsConfig;
- QtxActionToolMgr* aMgr = toolMgr();
+#ifdef _DEBUG
+ QtxActionToolMgr* aMgr =
+#endif
+ toolMgr();
QStringList aToolbars = myToolbars.keys();
QIntList aActionsIds;
foreach(QString aName, aToolbars) {
LightApp_Study* aStudy = dynamic_cast<LightApp_Study*>( myModule->application()->activeStudy() );
QString aNewTmpDir = aStudy->GetTmpDir("", false).c_str();
- bool isDone = true;
QDir aDir(aTmpDir);
QStringList aFiles = aDir.entryList(QDir::Files);
QStringList::const_iterator anIt = aFiles.begin(), aLast = aFiles.end();
{
public:
SHAPERGUI_CommandIdItem(QListWidget* theParent, int theId, SHAPERGUI* theModule)
- : QListWidgetItem(theParent), myId(theId), myModule(theModule) {}
+ : QListWidgetItem(theParent), myModule(theModule), myId(theId) {}
virtual QVariant data(int theRole) const {
/// Initializes the algorithm
SELECTOR_EXPORT Selector_Algo();
+ virtual ~Selector_Algo() {}
+
/// Initializes the selector structure on the label.
/// Stores the name data to restore after modification.
/// \param theContext whole shape that contains the selected sub-shape
return false;
myShapeType = TopAbs_ShapeEnum(aShapeTypeAttr->Get());
// restore sub-selectors
- bool aSubResult = true;
for(TDF_ChildIterator aSub(label(), false); aSub.More(); aSub.Next()) {
Selector_Algo* aSubSel = restoreByLab(aSub.Value(), baseDocument());
if (!append(aSubSel, false)) {
aResult = aWire;
break;
}
+ default:
+ break;
}
TopoDS_ListOfShape aSubSelectorShapes;
std::list<Selector_Algo*>::const_iterator aSubSel = list().cbegin();
myNBLevel.push_back(anArray->Value(anIndex));
}
// restore sub-selectors
- bool aSubResult = true;
for(TDF_ChildIterator aSub(label(), false); aSub.More(); aSub.Next()) {
Selector_Algo* aSubSel = restoreByLab(aSub.Value(), baseDocument());
if (!append(aSubSel, false)) {
// some selector fails, try to use rest selectors, myNBLevel becomes negative: unused
if (myNBLevel.size() > list().size()) {
std::list<int>::iterator aListIter = myNBLevel.begin();
- for(int a = 0; a < list().size(); a++)
+ for(size_t a = 0; a < list().size(); a++)
aListIter++;
*aListIter = -*aListIter;
list().push_back(NULL);
return false;
myShapeType = TopAbs_ShapeEnum(aShapeTypeAttr->Get());
// restore sub-selectors
- bool aSubResult = true;
for(TDF_ChildIterator aSub(label(), false); aSub.More(); aSub.Next()) {
Selector_Algo* aSubSel = restoreByLab(aSub.Value(), baseDocument());
if (!append(aSubSel, false)) {
#include <string>
/// Size of the list of constraint attributes
-const unsigned int CONSTRAINT_ATTR_SIZE = 4;
+const int CONSTRAINT_ATTR_SIZE = 4;
/** \class SketchPlugin_Constraint
* \brief Abstract interface to the SketchPlugin_ConstraintBase
GeomDataAPI_Point2D>(aFeature->data()->attribute(SketchPlugin_Line::END_ID()));
if (aPoint1.get() && aPoint2.get()) {
- double aLenght = aPoint1->pnt()->distance(aPoint2->pnt());
-
- //std::shared_ptr<ModelAPI_AttributeDouble> aValueAttr = std::dynamic_pointer_cast<
- // ModelAPI_AttributeDouble>(data()->attribute(SketchPlugin_Constraint::VALUE()));
- //if(!aValueAttr->isInitialized()) {
- // aValueAttr->setValue(aLenght);
- //}
-
// the value should to be computed here, not in the getAISObject
// in order to change the model value
// inside the object transaction. This is important for creating a constraint by preselection.
ModelAPI_AttributeRefAttr>(data()->attribute(SketchPlugin_Constraint::ENTITY_A()));
FeaturePtr aFeature = ModelAPI_Feature::feature(aRef->object());
if (aFeature) {
- double aRadius = 0;
- std::shared_ptr<ModelAPI_Data> aData = aFeature->data();
- if (aFeature->getKind() == SketchPlugin_Circle::ID()) {
- AttributeDoublePtr anAttribute = std::dynamic_pointer_cast<ModelAPI_AttributeDouble>(
- aData->attribute(SketchPlugin_Circle::RADIUS_ID()));
- if (anAttribute)
- aRadius = anAttribute->value();
- } else if (aFeature->getKind() == SketchPlugin_Arc::ID()) {
- std::shared_ptr<GeomDataAPI_Point2D> aCenterAttr = std::dynamic_pointer_cast<
- GeomDataAPI_Point2D>(aData->attribute(SketchPlugin_Arc::CENTER_ID()));
- std::shared_ptr<GeomDataAPI_Point2D> aStartAttr = std::dynamic_pointer_cast<
- GeomDataAPI_Point2D>(aData->attribute(SketchPlugin_Arc::START_ID()));
- if (aCenterAttr && aStartAttr)
- aRadius = aCenterAttr->pnt()->distance(aStartAttr->pnt());
- }
- //std::shared_ptr<ModelAPI_AttributeDouble> aValueAttr = std::dynamic_pointer_cast<
- // ModelAPI_AttributeDouble>(data()->attribute(SketchPlugin_Constraint::VALUE()));
- //if(!aValueAttr->isInitialized()) {
- // aValueAttr->setValue(aRadius);
- //}
-
// the value should to be computed here,
// not in the getAISObject in order to change the model value
// inside the object transaction. This is important for creating a constraint by preselection.
const AttributePtr theAttribute);
SketchPlugin_Fillet::SketchPlugin_Fillet()
-: myFilletCreated(false), myIsReversed(false)
+: myIsReversed(false), myFilletCreated(false)
{
myIsNotInversed[0] = myIsNotInversed[1] = true;
}
}
void SketchPlugin_MacroCircle::attributeChanged(const std::string& theID) {
- double aRadius = 0.0;
// If circle type switched reset all attributes.
if(theID == CIRCLE_TYPE()) {
SketchPlugin_Tools::resetAttribute(this, CENTER_POINT_ID());
continue; // already processed
theCoincidences.insert(*aCIt);
// iterate on coincident attributes
- for (int i = 0, aPtInd = 0; i < CONSTRAINT_ATTR_SIZE; ++i) {
+ for (int i = 0; i < CONSTRAINT_ATTR_SIZE; ++i) {
AttributeRefAttrPtr aRefAttr = (*aCIt)->refattr(SketchPlugin_Constraint::ATTRIBUTE(i));
if (aRefAttr && !aRefAttr->isObject())
{
static const double PI = 3.141592653589793238463;
-static const std::string OPERATION_HIGHLIGHT_COLOR() { return "128, 0, 0"; }
-static const std::string OPERATION_REMOVE_FEATURE_COLOR() { return "255, 174, 201"; }
-
SketchPlugin_Trim::SketchPlugin_Trim()
{
}
// there is a check whether the feature contains a point and a linear edge or two point values
std::string aParamA = theArguments.front();
- SessionPtr aMgr = ModelAPI_Session::get();
- ModelAPI_ValidatorsFactory* aFactory = aMgr->validators();
FeaturePtr anAttributeFeature =
std::dynamic_pointer_cast<ModelAPI_Feature>(theAttribute->owner());
}
std::string aParamA = theArguments.front();
- SessionPtr aMgr = ModelAPI_Session::get();
- ModelAPI_ValidatorsFactory* aFactory = aMgr->validators();
FeaturePtr anOwner = std::dynamic_pointer_cast<ModelAPI_Feature>(theAttribute->owner());
AttributeRefAttrPtr aRefAttr =
// there is a check whether the feature contains a point and a linear edge or two point values
std::string aParamA = theArguments.front();
- SessionPtr aMgr = ModelAPI_Session::get();
- ModelAPI_ValidatorsFactory* aFactory = aMgr->validators();
FeaturePtr aConstraint = std::dynamic_pointer_cast<ModelAPI_Feature>(theAttribute->owner());
AttributeRefAttrPtr aRefAttrA = aConstraint->data()->refattr(aParamA);
// there is a check whether the feature contains a point and a linear edge or two point values
std::string aParamA = theArguments.front();
- SessionPtr aMgr = ModelAPI_Session::get();
- ModelAPI_ValidatorsFactory* aFactory = aMgr->validators();
FeaturePtr anAttributeFeature =
std::dynamic_pointer_cast<ModelAPI_Feature>(theAttribute->owner());
IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Angle, AIS_AngleDimension);
SketcherPrs_Angle::SketcherPrs_Angle(ModelAPI_Feature* theConstraint,
- SketchPlugin_Sketch* theSketcher)
-: AIS_AngleDimension(gp_Pnt(0,0,0), gp_Pnt(1,0,0), gp_Pnt(0,1,0)), myConstraint(theConstraint),
+ SketchPlugin_Sketch* theSketcher)
+: AIS_AngleDimension(gp_Pnt(0,0,0), gp_Pnt(1,0,0), gp_Pnt(0,1,0)),
+ myConstraint(theConstraint),
mySketcher(theSketcher),
- myFirstPoint(gp_Pnt(0,0,0)), myCenterPoint(gp_Pnt(1,0,0)), mySecondPoint(gp_Pnt(0,1,0)),
- myValue(90., false, ""), myFlyOutPoint(0, 0.5, 0)
+ myFirstPoint(gp_Pnt(0,0,0)),
+ mySecondPoint(gp_Pnt(0,1,0)),
+ myCenterPoint(gp_Pnt(1, 0, 0)),
+ myFlyOutPoint(0, 0.5, 0),
+ myValue(90., false, "")
{
myAspect = new Prs3d_DimensionAspect();
myAspect->MakeArrows3d(false);
if (anAttrC.get() == NULL)
return aReadyToDisplay;
- SketcherPrs_PositionMgr* aMgr = SketcherPrs_PositionMgr::get();
int aNb = anAttrB->size();
// If size of source objects and mirrored ones is not equal then the constraint is not computed
if (aNb != anAttrC->size())
gp_Vec aVecPos;
// If number of angle less then number of symbols then each symbol can be placed
// directly inside of the angle
- if (aAngles.size() >= aPos[1] && !aVectors.empty()) {
+ if ((int)aAngles.size() >= aPos[1] && !aVectors.empty()) {
int aId = aPos[0];
aVecPos = *(std::next(aVectors.begin(), aId));
double aAng;
std::list<double>::const_iterator aItAng;
- double aAngPos;
bool aHasPlace = false;
- //int aIntId = 0; // a position inside a one sector
while (aPosCount < aPos[1]) {
for (aItAng = aAngles.cbegin(), aItVec = aVectors.cbegin();
aItAng != aAngles.cend(); ++aItAng, ++aItVec) {
if ((!aHasPlace) && (aPosCount >= (aPos[0] + 1))) {
aHasPlace = true;
- aAngPos = (*aItAng);
aVecPos = (*aItVec);
- //aIntId = aPos[0] - (aPosCount - Nb);
}
}
if (aPosCount < aPos[1]) {
SketcherPrs_SymbolPrs::SketcherPrs_SymbolPrs(ModelAPI_Feature* theConstraint,
SketchPlugin_Sketch* theSketcher)
- : AIS_InteractiveObject(), myConstraint(theConstraint),
- myIsCustomColor(false),
- mySketcher(theSketcher)
+ : AIS_InteractiveObject(),
+ myConstraint(theConstraint),
+ mySketcher(theSketcher),
+ myIsCustomColor(false)
{
SetAutoHilight(Standard_False);
}
std::shared_ptr<GeomAPI_Pnt> aPnt1 = aEdge->firstPoint();
std::shared_ptr<GeomAPI_Pnt> aPnt2 = aEdge->lastPoint();
- gp_Pnt aP1 = aPnt1->impl<gp_Pnt>();
- gp_Pnt aP2 = aPnt2->impl<gp_Pnt>();
// Draw line by two points
Handle(Graphic3d_ArrayOfSegments) aLines = new Graphic3d_ArrayOfSegments(2, 1);
#endif
#endif
+#if defined __GNUC__ || defined __clang__
+#define MAYBE_UNUSED __attribute__((unused))
+#else
+#define MAYBE_UNUSED
+#endif
+
#endif
//********************************************************************
XGUI_ActiveControlSelector* XGUI_ActiveControlMgr::getSelector(const QString& theType)
{
- XGUI_ActiveControlSelector* aSelector;
+ XGUI_ActiveControlSelector* aSelector = 0;
for (int i = 0, aCount = mySelectors.count(); i < aCount; i++)
{
if (mySelectors[i]->getType() != theType)
bool XGUI_ColorDialog::isRandomColor() const
{
- int anId = myButtonGroup->checkedId();
-
return myButtonGroup->checkedId() == 1;
}
aSelMgr->selection()->getSelected(ModuleBase_ISelection::Viewer);
if (aPrsList.size() > 0) {
bool isVisible = false;
- bool isShading = false;
bool canBeShaded = false;
bool hasPlanar = false;
ObjectPtr aObject;
GeomShapePtr aShape = aPrs->shape();
if (aObject->isDisplayed()) {
isVisible = true;
- canBeShaded = myWorkshop->displayer()->canBeShaded(aObject);
- isShading =
- (myWorkshop->displayer()->displayMode(aObject) == XGUI_Displayer::Shading);
+ canBeShaded = aDisplayer->canBeShaded(aObject);
}
if (aShape.get()) {
if (aShape->isPlanar()) {
QObjectPtrList aCreated;
std::set<ObjectPtr>::const_iterator aIt;
- bool aRebuildAll = false;
for (aIt = aObjects.cbegin(); aIt != aObjects.cend(); aIt++) {
ObjectPtr aObj = (*aIt);
if (aObj->groupName() == ModelAPI_ResultField::group()) {
//**************************************************************
XGUI_Displayer::XGUI_Displayer(XGUI_Workshop* theWorkshop)
-: myWorkshop(theWorkshop), myNeedUpdate(false),
- myViewerBlockedRecursiveCount(0), myContextId(0)
+: myWorkshop(theWorkshop),
+ myViewerBlockedRecursiveCount(0),
+ myContextId(0),
+ myNeedUpdate(false)
{
BRepMesh_IncrementalMesh::SetParallelDefault(Standard_True);
}
Handle(AIS_Shape) anOwnerPresentation =
Handle(AIS_Shape)::DownCast(anOwner->Selectable());
const TopoDS_Shape& aPresentationShape = anOwnerPresentation->Shape();
- if (aParameterShape.IsSame(anOwnerPresentation->Shape()) &&
+ if (aParameterShape.IsSame(aPresentationShape) &&
!aCompsolidPresentations.Contains(anOwnerPresentation))
aCompsolidPresentations.Add(anOwnerPresentation);
}
XGUI_ErrorMgr::XGUI_ErrorMgr(QObject* theParent, ModuleBase_IWorkshop* theWorkshop)
: ModuleBase_IErrorMgr(theParent),
+ myWorkshop(theWorkshop),
myErrorDialog(0),
myErrorLabel(0),
- myWorkshop(theWorkshop),
- myAcceptAllToolTip(""),
- myAcceptAllStatusTip(""),
myAcceptToolTip(""),
- myAcceptStatusTip("")
+ myAcceptAllToolTip(""),
+ myAcceptStatusTip(""),
+ myAcceptAllStatusTip("")
{
}
void XGUI_ErrorMgr::updateActions(const FeaturePtr& theFeature)
{
//update Ok Action and header of property panel if the current operation started for the feature
- XGUI_ActionsMgr* anActionsMgr = workshop()->actionsMgr();
ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
(workshop()->operationMgr()->currentOperation());
if (aFOperation && aFOperation->feature() == theFeature) {
void XGUI_ErrorMgr::storeInitialActionValues()
{
- ModuleBase_ModelWidget* anActiveWidget = activeWidget();
XGUI_ActionsMgr* anActionsMgr = workshop()->actionsMgr();
QAction* anAcceptAllAction = anActionsMgr->operationStateAction(XGUI_ActionsMgr::AcceptAll);
myAcceptAllToolTip = anAcceptAllAction->toolTip();
//********************************************************************
XGUI_FacesPanel::XGUI_FacesPanel(QWidget* theParent, XGUI_Workshop* theWorkshop)
- : QDockWidget(theParent), myIsActive(false), myWorkshop(theWorkshop)
+ : QDockWidget(theParent), myWorkshop(theWorkshop), myIsActive(false)
{
setWindowTitle(tr("Hide Faces"));
setObjectName("Hide Faces");
- QAction* aViewAct = toggleViewAction();
+ MAYBE_UNUSED QAction* aViewAct = toggleViewAction();
setStyleSheet("::title { position: relative; padding-left: 5px; text-align: left center }");
QWidget* aContent = new QWidget(this);
if (aSelectedIds.empty())
return false;
- bool isModified = false;
std::set<ModuleBase_ViewerPrsPtr> aRestored;
std::set<int>::const_iterator anIt;
for (anIt = aSelectedIds.begin(); anIt != aSelectedIds.end(); anIt++) {
if (aRestored.find(aPrs) == aRestored.end()) {
aRestored.insert(aPrs);
myItems.remove(*anIt);
- isModified = true;
}
}
std::map<ObjectPtr, TopoDS_ListOfShape> anObjectToShapes;
{
myHistoryList->clear();
foreach(ActionInfo anAct, theActions) {
- QListWidgetItem* anItem = new QListWidgetItem(anAct.icon, anAct.text, myHistoryList);
+#ifdef _DEBUG
+ QListWidgetItem* anItem =
+#endif
+ new QListWidgetItem(anAct.icon, anAct.text, myHistoryList);
}
}
case GeomAPI_Shape::COMPOUND:
fillContainer(aShape);
break;
+ default: // [to avoid compilation warning]
+ break;
}
}
class ModuleBase_PageWidget;
/// Internal name of property panel widget
-const static char* INSPECTION_PANEL = "inspection_panel_dock";
+MAYBE_UNUSED const static char* INSPECTION_PANEL = "inspection_panel_dock";
/**
* \ingroup GUI
std::list<std::shared_ptr<Config_FeatureMessage> >::const_iterator aFIt =
aFeaturesInfo.begin(), aFLast = aFeaturesInfo.end();
size_t aFSize = aFeaturesInfo.size();
- for(int i = 0; aFIt != aFLast; aFIt++, i++) {
+ for(size_t i = 0; aFIt != aFLast; aFIt++, i++) {
std::shared_ptr<Config_FeatureMessage> aMessage = *aFIt;
bool aUseSeparator = i == aFSize-1;
QAction* aAction = buildAction(aMessage, aWchName, aUseSeparator);
void XGUI_ModuleConnector::setSelected(const QList<ModuleBase_ViewerPrsPtr>& theValues)
{
- XGUI_Displayer* aDisp = myWorkshop->displayer();
XGUI_ObjectsBrowser* aBrowser = myWorkshop->objectBrowser();
if (theValues.isEmpty()) {
myWorkshop->selector()->clearSelection();
XGUI_OperationMgr::XGUI_OperationMgr(QObject* theParent,
ModuleBase_IWorkshop* theWorkshop)
-: QObject(theParent), myWorkshop(theWorkshop), mySHIFTPressed(false), myActiveMessageBox(0)
+: QObject(theParent), myWorkshop(theWorkshop), myActiveMessageBox(0), mySHIFTPressed(false)
{
/// we need to install filter to the application in order to react to 'Delete' key button
/// this key can not be a short cut for a corresponded action because we need to set
QListIterator<ModuleBase_Operation*> anIt(myOperations);
anIt.toBack();
- ModuleBase_Operation* aPreviousOperation = 0;
while (anIt.hasPrevious() && !isGranted) {
ModuleBase_Operation* anOp = anIt.previous();
if (anOp)
bool XGUI_OperationMgr::onKeyPressed(QObject *theObject, QKeyEvent* theEvent)
{
// Let the manager decide what to do with the given key combination.
- ModuleBase_Operation* anOperation = currentOperation();
bool isAccepted = false;
switch (theEvent->key()) {
case Qt::Key_Escape: {
XGUI_PropertyPanel::XGUI_PropertyPanel(QWidget* theParent, XGUI_OperationMgr* theMgr)
: ModuleBase_IPropertyPanel(theParent),
+ myPanelPage(NULL),
myActiveWidget(NULL),
myPreselectionWidget(NULL),
myInternalActiveWidget(NULL),
- myPanelPage(NULL),
myOperationMgr(theMgr)
{
setWindowTitle(tr("Property Panel"));
- QAction* aViewAct = toggleViewAction();
+ MAYBE_UNUSED QAction* aViewAct = toggleViewAction();
setObjectName(PROP_PANEL);
setStyleSheet("::title { position: relative; padding-left: 5px; text-align: left center }");
class XGUI_OperationMgr;
/// Internal name of property panel widget
-const static char* PROP_PANEL = "property_panel_dock";
+MAYBE_UNUSED const static char* PROP_PANEL = "property_panel_dock";
/// Internal name of Ok button
-const static char* PROP_PANEL_OK = "property_panel_ok";
+MAYBE_UNUSED const static char* PROP_PANEL_OK = "property_panel_ok";
/// Internal name of Ok button
-const static char* PROP_PANEL_OK_PLUS = "property_panel_ok_plus";
+MAYBE_UNUSED const static char* PROP_PANEL_OK_PLUS = "property_panel_ok_plus";
/// Internal name of Cancel button
-const static char* PROP_PANEL_CANCEL = "property_panel_cancel";
+MAYBE_UNUSED const static char* PROP_PANEL_CANCEL = "property_panel_cancel";
/// Internal name of Help button
-const static char* PROP_PANEL_HELP = "property_panel_help";
+MAYBE_UNUSED const static char* PROP_PANEL_HELP = "property_panel_help";
/// Internal name of Preview button
-const static char* PROP_PANEL_PREVIEW = "property_panel_preview";
+MAYBE_UNUSED const static char* PROP_PANEL_PREVIEW = "property_panel_preview";
/**
* \ingroup GUI
return aPresentations;
QList<size_t> aSelectedIds; // Remember of selected address in order to avoid duplicates
- XGUI_Displayer* aDisplayer = myWorkshop->displayer();
for (aContext->InitDetected(); aContext->MoreDetected(); aContext->NextDetected()) {
Handle(SelectMgr_EntityOwner) anOwner = aContext->DetectedOwner();
if (!anOwner.IsNull()) {
return;
AIS_ListIteratorOfListOfInteractive aLIt;
+#ifdef _DEBUG
bool isActivationChanged = false;
+#endif
for(aLIt.Initialize(aPrsList); aLIt.More(); aLIt.Next()) {
anAISIO = aLIt.Value();
- if (activate(anAISIO, false))
+ if (activate(anAISIO, false)) {
+#ifdef _DEBUG
isActivationChanged = true;
+#endif
+ }
}
for(aLIt.Initialize(aPrsListToBeDeactivated); aLIt.More(); aLIt.Next()) {
anAISIO = aLIt.Value();
deactivateAIS(anAISIO);
+#ifdef _DEBUG
isActivationChanged = true;
+#endif
}
}
for (; itr.More(); itr.Next() ) {
Standard_Integer aMode = itr.Value();
aHasValidMode = aHasValidMode || aMode != -1;
- int aShapeMode = (aMode > 8)? aMode : AIS_Shape::SelectionType(aMode);
+ //int aShapeMode = (aMode > 8)? aMode : AIS_Shape::SelectionType(aMode);
if (!myActiveSelectionModes.contains(aMode)) {
deactivateAIS(theIO, aMode);
isDeactivated = true;
XGUI_Workshop::XGUI_Workshop(XGUI_SalomeConnector* theConnector)
: QObject(),
myModule(NULL),
- mySalomeConnector(theConnector),
+ myObjectBrowser(0),
myPropertyPanel(0),
- myInspectionPanel(0),
myFacesPanel(0),
- myObjectBrowser(0),
- myDisplayer(0)
- //myViewerSelMode(TopAbs_FACE)
+ myDisplayer(0),
+ mySalomeConnector(theConnector),
+ //myViewerSelMode(TopAbs_FACE),
+ myInspectionPanel(0)
{
mySelector = new XGUI_SelectionMgr(this);
myModuleConnector = new XGUI_ModuleConnector(this);
//******************************************************
void XGUI_Workshop::onAcceptActionClicked()
{
- QAction* anAction = dynamic_cast<QAction*>(sender());
XGUI_OperationMgr* anOperationMgr = operationMgr();
if (anOperationMgr) {
ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
(anOperationMgr->currentOperation());
if (aFOperation) {
- //if (errorMgr()->canProcessClick(anAction, aFOperation->feature()))
myOperationMgr->commitOperation();
}
}
//******************************************************
void XGUI_Workshop::onAcceptPlusActionClicked()
{
- QAction* anAction = dynamic_cast<QAction*>(sender());
XGUI_OperationMgr* anOperationMgr = operationMgr();
if (anOperationMgr) {
ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
aFace->computeSize(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
Handle(V3d_View) aView = myViewerProxy->activeView();
- double aScale = aView->Scale();
aView->SetAt(aPos->x(), aPos->y(), aPos->z());
aView->SetProj(aNormal->x(), aNormal->y(), aNormal->z());
Bnd_Box aBox;
void XGUI_Workshop::registerValidators() const
{
SessionPtr aMgr = ModelAPI_Session::get();
- ModelAPI_ValidatorsFactory* aFactory = aMgr->validators();
+ MAYBE_UNUSED ModelAPI_ValidatorsFactory* aFactory = aMgr->validators();
}
//**************************************************************
void XGUI_Workshop::updateAutoComputeState()
{
SessionPtr aMgr = ModelAPI_Session::get();
- bool isComputeBlocked = aMgr->isAutoUpdateBlocked();
#ifdef HAVE_SALOME
// QAction* aUpdateCmd;
// QList<QAction*> aCommands = mySalomeConnector->commandList();
// aUpdateCmd->setIcon(isComputeBlocked? QIcon(":pictures/autoapply_stop.png") :
// QIcon(":pictures/autoapply_start.png"));
#else
+ bool isComputeBlocked = aMgr->isAutoUpdateBlocked();
AppElements_MainMenu* aMenuBar = myMainWindow->menuObject();
AppElements_Command* aUpdateCmd = aMenuBar->feature("AUTOCOMPUTE_CMD");
aUpdateCmd->button()->setIcon(isComputeBlocked? QIcon(":pictures/autoapply_stop.png") :
: myWorkshop(theWorkshop),
myUpdatePrefs(false)
{
- XGUI_OperationMgr* anOperationMgr = workshop()->operationMgr();
}
//******************************************************
!anObject->isDisplayed();
if (!aHide) { // check that this is not hidden result
ResultPtr aRes = std::dynamic_pointer_cast<ModelAPI_Result>(anObject);
- bool isConcealed = aRes && aRes->isConcealed();
aHide = aRes && aRes->isConcealed();
// Hide the presentation with an empty shape. But isDisplayed state of the object should not
// be changed to the object becomes visible when the shape becomes not empty
}
}
- bool isCustomized = customizeFeature(anObjects, aDisplayed);
+ MAYBE_UNUSED bool isCustomized = customizeFeature(anObjects, aDisplayed);
//if (myObjectBrowser)
// myObjectBrowser->processEvent(theMsg);
return aDisplayed;
XGUI_Displayer* aDisplayer = aWorkshop->displayer();
- int aNb = aDisplayer->objectsCount();
return aDisplayer->display(theObj, false);
}