20 #ifndef ModelAPI_Tools_HeaderFile
21 #define ModelAPI_Tools_HeaderFile
24 #include <ModelAPI_AttributeSelectionList.h>
43 namespace ModelAPI_Tools {
45 MODELAPI_EXPORT std::shared_ptr<GeomAPI_Shape> shape(
46 const std::shared_ptr<ModelAPI_Result>& theResult);
52 MODELAPI_EXPORT std::string getFeatureError(
const std::shared_ptr<ModelAPI_Feature>& theFeature);
55 std::shared_ptr<ModelAPI_ResultBody> resultBody;
56 std::shared_ptr<GeomAPI_Shape> baseShape;
57 std::shared_ptr<GeomAlgoAPI_MakeShape> makeShape;
60 MODELAPI_EXPORT
void loadModifiedShapes(std::shared_ptr<ModelAPI_ResultBody> theResultBody,
61 const std::list<std::shared_ptr<GeomAPI_Shape>>& theBaseShapes,
62 const std::list<std::shared_ptr<GeomAPI_Shape>>& theTools,
63 const std::shared_ptr<GeomAlgoAPI_MakeShape>& theMakeShape,
64 const std::shared_ptr<GeomAPI_Shape> theResultShape,
65 const std::string& theNamePrefix =
"");
67 MODELAPI_EXPORT
void loadModifiedShapes(std::shared_ptr<ModelAPI_ResultBody> theResultBody,
68 const std::shared_ptr<GeomAPI_Shape>& theBaseShape,
69 const std::shared_ptr<GeomAlgoAPI_MakeShape>& theMakeShape,
70 const std::string theName);
72 MODELAPI_EXPORT
void loadDeletedShapes(std::shared_ptr<ModelAPI_ResultBody> theResultBody,
73 const std::shared_ptr<GeomAPI_Shape> theBaseShape,
74 const std::list<std::shared_ptr<GeomAPI_Shape>>& theTools,
75 const std::shared_ptr<GeomAlgoAPI_MakeShape>& theMakeShape,
76 const std::shared_ptr<GeomAPI_Shape> theResultShapesCompound);
79 MODELAPI_EXPORT
void loadDeletedShapes(std::vector<ResultBaseAlgo>& theResultBaseAlgoList,
80 const std::list<std::shared_ptr<GeomAPI_Shape>>& theTools,
81 const std::shared_ptr<GeomAPI_Shape> theResultShapesCompound);
88 MODELAPI_EXPORT
bool findVariable(
const std::shared_ptr<ModelAPI_Document>& theDocument,
89 std::shared_ptr<ModelAPI_Feature> theSearcher,
90 const std::wstring& theName,
double& outValue,
91 std::shared_ptr<ModelAPI_ResultParameter>& theParam);
99 MODELAPI_EXPORT
bool findVariable(std::shared_ptr<ModelAPI_Feature> theSearcher,
100 const std::wstring& theName,
101 double& outValue, std::shared_ptr<ModelAPI_ResultParameter>& theParam,
102 const std::shared_ptr<ModelAPI_Document>& theDocument = std::shared_ptr<ModelAPI_Document>());
111 MODELAPI_EXPORT std::shared_ptr<ModelAPI_Result> findPartResult(
112 const std::shared_ptr<ModelAPI_Document>& theMain,
113 const std::shared_ptr<ModelAPI_Document>& theSub);
122 MODELAPI_EXPORT std::shared_ptr<ModelAPI_Feature> findPartFeature(
123 const std::shared_ptr<ModelAPI_Document>& theMain,
124 const std::shared_ptr<ModelAPI_Document>& theSub);
131 MODELAPI_EXPORT std::shared_ptr<ModelAPI_CompositeFeature> compositeOwner(
132 const std::shared_ptr<ModelAPI_Feature>& theFeature);
140 MODELAPI_EXPORT std::shared_ptr<ModelAPI_ResultBody>
141 bodyOwner(
const std::shared_ptr<ModelAPI_Result>& theSub,
const bool theRoot =
false);
148 MODELAPI_EXPORT std::shared_ptr<ModelAPI_ResultBody> mainBody(
const std::shared_ptr<ModelAPI_ResultBody> theSubBody);
154 MODELAPI_EXPORT
int bodyIndex(
const std::shared_ptr<ModelAPI_Result>& theSub);
162 MODELAPI_EXPORT
bool hasSubResults(
const std::shared_ptr<ModelAPI_Result>& theResult);
167 MODELAPI_EXPORT
void allSubs(
const std::shared_ptr<ModelAPI_ResultBody>& theResult,
168 std::list<std::shared_ptr<ModelAPI_Result> >& theResults,
169 const bool theLowerOnly =
false);
174 MODELAPI_EXPORT
void allResults(
const std::shared_ptr<ModelAPI_Feature>& theFeature,
175 std::list<std::shared_ptr<ModelAPI_Result> >& theResults);
182 MODELAPI_EXPORT
bool allDocumentsActivated(std::wstring& theNotActivatedNames);
189 MODELAPI_EXPORT
bool removeFeaturesAndReferences(
190 const std::set<std::shared_ptr<ModelAPI_Feature> >& theFeatures,
191 const bool theFlushRedisplay =
false,
192 const bool theUseComposite =
false,
193 const bool theUseRecursion =
true);
200 MODELAPI_EXPORT
bool removeFeatures(
201 const std::set<std::shared_ptr<ModelAPI_Feature> >& theFeatures,
202 const bool theFlushRedisplay);
212 MODELAPI_EXPORT
void findAllReferences(
213 const std::set<std::shared_ptr<ModelAPI_Feature> >& theFeatures,
214 std::map<std::shared_ptr<ModelAPI_Feature>,
215 std::set<std::shared_ptr<ModelAPI_Feature> > >& theReferences,
216 const bool theUseComposite =
true,
217 const bool theUseRecursion =
true);
224 MODELAPI_EXPORT
void findRefsToFeatures(
225 const std::set<std::shared_ptr<ModelAPI_Feature> >& aFeatures,
226 const std::map<std::shared_ptr<ModelAPI_Feature>,
227 std::set<std::shared_ptr<ModelAPI_Feature> > >& aReferences,
228 std::set<std::shared_ptr<ModelAPI_Feature> >& aFeaturesRefsTo);
234 MODELAPI_EXPORT
void getConcealedResults(
const std::shared_ptr<ModelAPI_Feature>& theFeature,
235 std::list<std::shared_ptr<ModelAPI_Result> >& theResults);
242 MODELAPI_EXPORT std::pair<std::wstring, bool> getDefaultName(
243 const std::shared_ptr<ModelAPI_Result>& theResult,
244 const bool theInherited =
true,
245 const bool theRecursive =
false);
249 MODELAPI_EXPORT std::set<std::shared_ptr<ModelAPI_Feature> >
250 getParents(
const std::shared_ptr<ModelAPI_Feature>& theFeature);
257 MODELAPI_EXPORT
void fillShapeHierarchy(
258 const std::shared_ptr<GeomAPI_Shape>& theShape,
259 const std::shared_ptr<ModelAPI_Result>& theContext,
264 MODELAPI_EXPORT
void removeResults(
const std::list<std::shared_ptr<ModelAPI_Result> >& theResults);
270 MODELAPI_EXPORT
double getDeflection(
const std::shared_ptr<ModelAPI_Result>& theResult);
276 MODELAPI_EXPORT
void setDeflection(std::shared_ptr<ModelAPI_Result> theResult,
277 const double theDeflection);
283 MODELAPI_EXPORT
void getColor(
const std::shared_ptr<ModelAPI_Result>& theResult,
284 std::vector<int>& theColor);
291 MODELAPI_EXPORT
void getColor(
const std::shared_ptr<ModelAPI_Result> theResult,
292 const std::shared_ptr<GeomAPI_Shape> theShape,
293 std::vector<int>& theColor);
301 MODELAPI_EXPORT
void getColoredSubShapes(
const std::shared_ptr<ModelAPI_Result> theResult,
302 std::map<std::shared_ptr<GeomAPI_Shape>, std::vector<int>>& theColoredShapes,
303 bool theGetSubResults =
false);
309 MODELAPI_EXPORT
void removeSubShapeColors(
const std::shared_ptr<ModelAPI_Result> theResult);
315 MODELAPI_EXPORT
void setColor(std::shared_ptr<ModelAPI_Result> theResult,
316 const std::vector<int>& theColor);
323 MODELAPI_EXPORT
void setColor(std::shared_ptr<ModelAPI_Result> theResult,
324 std::shared_ptr<GeomAPI_Shape> theShape,
325 const std::vector<int>& theColor);
331 MODELAPI_EXPORT
void getIsoLines(
const std::shared_ptr<ModelAPI_Result>& theResult,
332 bool& isVisible, std::vector<int>& theNbLines);
338 MODELAPI_EXPORT
void setIsoLines(std::shared_ptr<ModelAPI_Result> theResult,
339 const std::vector<int>& theIso);
345 MODELAPI_EXPORT
void showIsoLines(std::shared_ptr<ModelAPI_Result> theResult,
bool theShow);
347 MODELAPI_EXPORT
bool isShownIsoLines(std::shared_ptr<ModelAPI_Result> theResult);
353 MODELAPI_EXPORT
void showEdgesDirection(std::shared_ptr<ModelAPI_Result> theResult,
bool theShow);
355 MODELAPI_EXPORT
bool isShowEdgesDirection(std::shared_ptr<ModelAPI_Result> theResult);
361 MODELAPI_EXPORT
void bringToFront(std::shared_ptr<ModelAPI_Result> theResult,
bool theFlag);
363 MODELAPI_EXPORT
bool isBringToFront(std::shared_ptr<ModelAPI_Result> theResult);
369 MODELAPI_EXPORT
double getTransparency(
const std::shared_ptr<ModelAPI_Result>& theResult);
375 MODELAPI_EXPORT
void setTransparency(std::shared_ptr<ModelAPI_Result> theResult,
376 double theTransparency);
383 MODELAPI_EXPORT
void copyVisualizationAttrs(std::shared_ptr<ModelAPI_Result> theSource,
384 std::shared_ptr<ModelAPI_Result> theDest);
390 MODELAPI_EXPORT
void copyImageAttribute(std::shared_ptr<ModelAPI_Result> theSource,
391 std::shared_ptr<ModelAPI_Result> theDest);
398 MODELAPI_EXPORT std::list<std::shared_ptr<ModelAPI_Feature> > referencedFeatures(
399 std::shared_ptr<ModelAPI_Result> theTarget,
const std::string& theFeatureKind,
400 const bool theSortResults);
405 MODELAPI_EXPORT
bool isInResults(AttributeSelectionListPtr theSelection,
406 const std::list<ResultPtr>& theResults,
407 std::set<ResultPtr>& theCashedResults);
415 MODELAPI_EXPORT
void findRandomColor(std::vector<int>& theValues,
bool theReset =
false);
424 MODELAPI_EXPORT std::wstring validateMovement(
425 const FeaturePtr& theAfter,
const std::list<FeaturePtr> theMoved);
Storage for the hierarchy of shapes and their parents (compounds or compsolids)
Definition: GeomAPI_ShapeHierarchy.h:34
Interface to the topological shape object.
Definition: GeomAPI_Shape.h:43
Interface to the root class of all topological shapes constructions.
Definition: GeomAlgoAPI_MakeShape.h:35
Feature that consists of other features: like sketcher with edges inside.
Definition: ModelAPI_CompositeFeature.h:33
Document for internal data structure of any object storage.
Definition: ModelAPI_Document.h:53
Feature function that represents the particular functionality of this operation.
Definition: ModelAPI_Feature.h:41
The body (shape) result of a feature.
Definition: ModelAPI_ResultBody.h:43
The construction element result of a feature.
Definition: ModelAPI_ResultParameter.h:34
The result of a feature.
Definition: ModelAPI_Result.h:37