GEOMAPI_EXPORT double angleRadian();
/// Returns \c true if the line is reversed during angle calculation.
- /// If theIndex = 0, the result corresponds to the first line, if theIndex = 1, the to the second line
+ /// If theIndex = 0, the result corresponds to the first line,
+ /// if theIndex = 1, the to the second line
GEOMAPI_EXPORT bool isReversed(int theIndex);
};
GEOMAPI_EXPORT double angleRadian();
/// Returns \c true if the line is reversed during angle calculation.
- /// If theIndex = 0, the result corresponds to the first line, if theIndex = 1, the to the second line
+ /// If theIndex = 0, the result corresponds to the first line,
+ /// if theIndex = 1, the to the second line
GEOMAPI_EXPORT bool isReversed(int theIndex);
};
std::shared_ptr<GeomAPI_Ax1> GeomAPI_Ax1::reversed()
{
gp_Ax1 anAxis = MY_AX1->Reversed();
- std::shared_ptr<GeomAPI_Pnt> aPnt(new GeomAPI_Pnt(anAxis.Location().X(), anAxis.Location().Y(), anAxis.Location().Z()));
- std::shared_ptr<GeomAPI_Dir> aDir(new GeomAPI_Dir(anAxis.Direction().X(), anAxis.Direction().Y(), anAxis.Direction().Z()));
+ std::shared_ptr<GeomAPI_Pnt> aPnt(
+ new GeomAPI_Pnt(anAxis.Location().X(), anAxis.Location().Y(), anAxis.Location().Z()));
+ std::shared_ptr<GeomAPI_Dir> aDir(
+ new GeomAPI_Dir(anAxis.Direction().X(), anAxis.Direction().Y(), anAxis.Direction().Z()));
return std::shared_ptr<GeomAPI_Ax1>(new GeomAPI_Ax1(aPnt, aDir));
}
double& theParameter) const
{
Handle(Geom_Circle) aCurve = new Geom_Circle(*MY_CIRC);
- return GeomLib_Tool::Parameter(aCurve, thePoint->impl<gp_Pnt>(), theTolerance, theParameter) == Standard_True;
+ return GeomLib_Tool::Parameter(aCurve, thePoint->impl<gp_Pnt>(),
+ theTolerance, theParameter) == Standard_True;
}
//=================================================================================================
double& theParameter) const
{
Handle(Geom2d_Circle) aCurve = new Geom2d_Circle(*MY_CIRC2D);
- return GeomLib_Tool::Parameter(aCurve, thePoint->impl<gp_Pnt2d>(), theTolerance, theParameter) == Standard_True;
+ return GeomLib_Tool::Parameter(aCurve, thePoint->impl<gp_Pnt2d>(),
+ theTolerance, theParameter) == Standard_True;
}
//=================================================================================================
/// \brief Binds list of shapes to the key shape.
/// \param[in] theKey key shape.
- /// \param[in] theItems list of shapes. If shapes have duplications in list only one will be stored.
+ /// \param[in] theItems list of shapes.
+ /// If shapes have duplications in list only one will be stored.
/// \returns true if items bound successfully.
GEOMAPI_EXPORT bool bind(const std::shared_ptr<GeomAPI_Shape> theKey,
const ListOfShape& theItems);
return implPtr<TopTools_DataMapOfShapeShape>()->Extent();
}
-bool GeomAPI_DataMapOfShapeShape::bind (std::shared_ptr<GeomAPI_Shape> theKey, std::shared_ptr<GeomAPI_Shape> theItem)
+bool GeomAPI_DataMapOfShapeShape::bind(std::shared_ptr<GeomAPI_Shape> theKey,
+ std::shared_ptr<GeomAPI_Shape> theItem)
{
bool flag(false);
- if(implPtr<TopTools_DataMapOfShapeShape>()->Bind(theKey->impl<TopoDS_Shape>(), theItem->impl<TopoDS_Shape>()))
- flag = true;
+ if (implPtr<TopTools_DataMapOfShapeShape>()->Bind(theKey->impl<TopoDS_Shape>(),
+ theItem->impl<TopoDS_Shape>()))
+ flag = true;
return flag;
}
}
}
-void GeomAPI_DataMapOfShapeShape::merge(const std::shared_ptr<GeomAPI_DataMapOfShapeShape> theDataMap)
+void GeomAPI_DataMapOfShapeShape::
+ merge(const std::shared_ptr<GeomAPI_DataMapOfShapeShape> theDataMap)
{
if(theDataMap.get()) {
merge(*theDataMap.get());
return flag;
}
-const std::shared_ptr<GeomAPI_Shape> GeomAPI_DataMapOfShapeShape::find(std::shared_ptr<GeomAPI_Shape> theKey)
+const std::shared_ptr<GeomAPI_Shape>
+ GeomAPI_DataMapOfShapeShape::find(std::shared_ptr<GeomAPI_Shape> theKey)
{
std::shared_ptr<GeomAPI_Shape> aShape(new GeomAPI_Shape());
- aShape->setImpl(new TopoDS_Shape(impl<TopTools_DataMapOfShapeShape>().Find(theKey->impl<TopoDS_Shape>())));
+ aShape->setImpl(
+ new TopoDS_Shape(impl<TopTools_DataMapOfShapeShape>().Find(theKey->impl<TopoDS_Shape>())));
return aShape;
}
/// Adds \a theKey to me with \a theItem. Returns True if the Key was not already in the map.
GEOMAPI_EXPORT
- bool bind (const std::shared_ptr<GeomAPI_Shape> theKey, const std::shared_ptr<GeomAPI_Shape> theItem);
+ bool bind (const std::shared_ptr<GeomAPI_Shape> theKey,
+ const std::shared_ptr<GeomAPI_Shape> theItem);
/// Merges two maps.
GEOMAPI_EXPORT void merge(const GeomAPI_DataMapOfShapeShape& theDataMap);
return MY_DIR->Angle(theArg->impl<gp_Dir>());
}
-bool GeomAPI_Dir::isParallel(const std::shared_ptr<GeomAPI_Dir> theDir, const double theTolerance) const
+bool GeomAPI_Dir::isParallel(const std::shared_ptr<GeomAPI_Dir> theDir,
+ const double theTolerance) const
{
return MY_DIR->IsParallel(theDir->impl<gp_Dir>(), theTolerance) == Standard_True;
}
GEOMAPI_EXPORT
double angle(const std::shared_ptr<GeomAPI_Dir>& theArg) const;
- /// \return true if the angle between this unit vector and theDir unit vector is equal to 0 or to Pi.
+ /// \return true if the angle between this unit vector and
+ /// theDir unit vector is equal to 0 or to Pi.
GEOMAPI_EXPORT
- bool isParallel(const std::shared_ptr<GeomAPI_Dir> theDir, const double theTolerance = 1.e-7) const;
+ bool isParallel(const std::shared_ptr<GeomAPI_Dir> theDir,
+ const double theTolerance = 1.e-7) const;
};
GEOMAPI_EXPORT virtual ~GeomAPI_ICustomPrs();
/// Modifies the given presentation in the custom way.
- virtual bool customisePresentation(std::shared_ptr<ModelAPI_Result> theResult, AISObjectPtr thePrs,
+ virtual bool customisePresentation(std::shared_ptr<ModelAPI_Result> theResult,
+ AISObjectPtr thePrs,
std::shared_ptr<GeomAPI_ICustomPrs> theDefaultPrs) = 0;
};
return std::shared_ptr<GeomAPI_Pnt>(new GeomAPI_Pnt(aResult.X(), aResult.Y(), aResult.Z()));
}
-bool GeomAPI_Lin::contains(const std::shared_ptr<GeomAPI_Pnt> thePoint, const double theLinearTolerance) const
+bool GeomAPI_Lin::contains(const std::shared_ptr<GeomAPI_Pnt> thePoint,
+ const double theLinearTolerance) const
{
if(!thePoint.get()) {
return false;
bool GeomAPI_Lin::isParallel(const std::shared_ptr<GeomAPI_Lin> theLin) const
{
- return MY_LIN->Direction().IsParallel(theLin->impl<gp_Lin>().Direction(), Precision::Confusion()) == Standard_True;
+ return MY_LIN->Direction().IsParallel(theLin->impl<gp_Lin>().Direction(),
+ Precision::Confusion()) == Standard_True;
}
bool GeomAPI_Lin::isCoplanar(const std::shared_ptr<GeomAPI_Lin> theLin) const
const std::shared_ptr<GeomAPI_Pnt> project(
const std::shared_ptr<GeomAPI_Pnt>& thePoint) const;
- /// \return true if this line contains thePoint, that is, if the distance between thePoint and this line
+ /// \return true if this line contains thePoint, that is,
+ /// if the distance between thePoint and this line
/// is less than or equal to theLinearTolerance.
GEOMAPI_EXPORT
- bool contains(const std::shared_ptr<GeomAPI_Pnt> thePoint, const double theLinearTolerance = 1.e-7) const;
+ bool contains(const std::shared_ptr<GeomAPI_Pnt> thePoint,
+ const double theLinearTolerance = 1.e-7) const;
/// \return true if lines are parallel.
GEOMAPI_EXPORT
aVec.Reverse();
aVec.Scale(theShift);
gp_Lin2d aLin = MY_LIN2D->Translated(aVec);
- return std::shared_ptr<GeomAPI_Pnt2d>(new GeomAPI_Pnt2d(aLin.Location().X(), aLin.Location().Y()));
+ return std::shared_ptr<GeomAPI_Pnt2d>(new GeomAPI_Pnt2d(aLin.Location().X(),
+ aLin.Location().Y()));
}
GEOMAPI_EXPORT
const std::shared_ptr<GeomAPI_Pnt2d> project(
const std::shared_ptr<GeomAPI_Pnt2d>& thePoint) const;
- /// Computes the cross product of the line direction and a vector from the line start point to the point
+ /// Computes the cross product of the line direction and a vector
+ /// from the line start point to the point
GEOMAPI_EXPORT
bool isRight(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint) const;
impl<gp_Pln>().Coefficients(theA, theB, theC, theD);
}
-bool GeomAPI_Pln::isCoincident(const std::shared_ptr<GeomAPI_Pln> thePlane, const double theTolerance)
+bool GeomAPI_Pln::isCoincident(const std::shared_ptr<GeomAPI_Pln> thePlane,
+ const double theTolerance)
{
if(!thePlane.get()) {
return false;
const gp_Pln& aMyPln = impl<gp_Pln>();
const gp_Pln& anOtherPln = thePlane->impl<gp_Pln>();
- return (aMyPln.Contains(anOtherPln.Location(), theTolerance) && aMyPln.Axis().IsParallel(anOtherPln.Axis(), theTolerance));
+ return (aMyPln.Contains(anOtherPln.Location(), theTolerance) &&
+ aMyPln.Axis().IsParallel(anOtherPln.Axis(), theTolerance));
}
bool GeomAPI_Pln::isParallel(const std::shared_ptr<GeomAPI_Lin> theLine)
return Abs(aDot) < Precision::SquareConfusion();
}
-std::shared_ptr<GeomAPI_Pnt> GeomAPI_Pln::intersect(const std::shared_ptr<GeomAPI_Lin>& theLine) const
+std::shared_ptr<GeomAPI_Pnt>
+ GeomAPI_Pln::intersect(const std::shared_ptr<GeomAPI_Lin>& theLine) const
{
std::shared_ptr<GeomAPI_XYZ> aLineDir = theLine->direction()->xyz();
std::shared_ptr<GeomAPI_XYZ> aLineLoc = theLine->location()->xyz();
return std::shared_ptr<GeomAPI_Pnt>();
double aParam = aNormal->dot(aLocation->decreased(aLineLoc)) / aDot;
- return std::shared_ptr<GeomAPI_Pnt>(new GeomAPI_Pnt(aLineLoc->added(aLineDir->multiplied(aParam))));
+ return std::shared_ptr<GeomAPI_Pnt>(
+ new GeomAPI_Pnt(aLineLoc->added(aLineDir->multiplied(aParam))));
}
-std::shared_ptr<GeomAPI_Pnt> GeomAPI_Pln::project(const std::shared_ptr<GeomAPI_Pnt>& thePoint) const
+std::shared_ptr<GeomAPI_Pnt>
+ GeomAPI_Pln::project(const std::shared_ptr<GeomAPI_Pnt>& thePoint) const
{
std::shared_ptr<GeomAPI_XYZ> aNormal = direction()->xyz();
std::shared_ptr<GeomAPI_XYZ> aLocation = location()->xyz();
implPtr<gp_Pln>()->Translate(aVec);
}
-std::shared_ptr<GeomAPI_Lin> GeomAPI_Pln::intersect(const std::shared_ptr<GeomAPI_Pln> thePlane) const
+std::shared_ptr<GeomAPI_Lin>
+ GeomAPI_Pln::intersect(const std::shared_ptr<GeomAPI_Pln> thePlane) const
{
std::shared_ptr<GeomAPI_Lin> aRes;
const TopoDS_Shape& aShape = const_cast<GeomAPI_Shape*>(this)->impl<TopoDS_Shape>();
if (aShape.IsNull() || aShape.ShapeType() != TopAbs_COMPOUND)
return false;
- NCollection_List<TopoDS_Shape> aNotConnected; // list of simple elements that are not detected in connection to others
+ // list of simple elements that are not detected in connection to others
+ NCollection_List<TopoDS_Shape> aNotConnected;
addSimpleToList(aShape, aNotConnected);
if (aNotConnected.IsEmpty()) // an empty compound
return false;
bool aConnected = false;
NCollection_List<TopoDS_Shape>::Iterator aNewIter(aNewConnected);
for(; !aConnected && aNewIter.More(); aNewIter.Next()) {
- // checking topological connecion of aNotIter and aNewIter (if shapes are connected, vertices are connected for sure)
+ // checking topological connecion of aNotIter and aNewIter
+ // (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);
Handle(Standard_Type) aType = aSurface->DynamicType();
if(aType == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
- Handle(Geom_RectangularTrimmedSurface) aTrimSurface = Handle(Geom_RectangularTrimmedSurface)::DownCast(aSurface);
+ Handle(Geom_RectangularTrimmedSurface) aTrimSurface =
+ Handle(Geom_RectangularTrimmedSurface)::DownCast(aSurface);
aType = aTrimSurface->BasisSurface()->DynamicType();
}
return (aType == STANDARD_TYPE(Geom_Plane)) == Standard_True;
GEOMAPI_EXPORT
bool more() const;
- /// Moves to the next Shape in the exploration or do nothing if there are no more shapes to explore.
+ /// Moves to the next Shape in the exploration or do nothing
+ /// if there are no more shapes to explore.
GEOMAPI_EXPORT
void next();
- /// \return the current shape in the exploration or empty pointer if this explorer has no more shapes to explore.
+ /// \return the current shape in the exploration or empty pointer
+ /// if this explorer has no more shapes to explore.
GEOMAPI_EXPORT
std::shared_ptr<GeomAPI_Shape> current();
/// \class GeomAPI_ShapeIterator
/// \ingroup DataModel
-/// \brief Iterates on the underlying shape underlying a given GeomAPI_Shape object, providing access
+/// \brief Iterates on the underlying shape underlying a given GeomAPI_Shape object,
+/// providing access
/// to its component sub-shapes. Each component shape is returned as a GeomAPI_Shape with
/// an orientation, and a compound of the original values and the relative values.
class GeomAPI_ShapeIterator : public GeomAPI_Interface
return myExpression[theComponent]->error();
}
-void GeomData_Point::setUsedParameters(int theComponent, const std::set<std::string>& theUsedParameters)
+void GeomData_Point::setUsedParameters(int theComponent,
+ const std::set<std::string>& theUsedParameters)
{
assert(theComponent >= 0 && theComponent < NUM_COMPONENTS);
myExpression[theComponent]->setUsedParameters(theUsedParameters);
class GeomData_Point : public GeomDataAPI_Point
{
enum { NUM_COMPONENTS = 3 };
- std::shared_ptr<ModelAPI_ExpressionDouble> myExpression[NUM_COMPONENTS]; ///< Expressions for X, Y and Z
+ /// Expressions for X, Y and Z
+ std::shared_ptr<ModelAPI_ExpressionDouble> myExpression[NUM_COMPONENTS];
public:
/// Defines the double value
GEOMDATA_EXPORT virtual void setValue(const double theX, const double theY, const double theZ);
GEOMDATA_EXPORT virtual std::shared_ptr<GeomAPI_Pnt> pnt();
/// Defines the calculated double value
- GEOMDATA_EXPORT virtual void setCalculatedValue(const double theX, const double theY, const double theZ);
+ GEOMDATA_EXPORT virtual
+ void setCalculatedValue(const double theX, const double theY, const double theZ);
/// Defines the text values
GEOMDATA_EXPORT virtual void setText(const std::string& theX,
return myExpression[theComponent]->error();
}
-void GeomData_Point2D::setUsedParameters(int theComponent, const std::set<std::string>& theUsedParameters)
+void GeomData_Point2D::setUsedParameters(int theComponent,
+ const std::set<std::string>& theUsedParameters)
{
assert(theComponent >= 0 && theComponent < NUM_COMPONENTS);
myExpression[theComponent]->setUsedParameters(theUsedParameters);
{
public:
/// Defines the double value
- GEOMDATAAPI_EXPORT virtual void setValue(const double theX, const double theY, const double theZ) = 0;
+ GEOMDATAAPI_EXPORT virtual
+ void setValue(const double theX, const double theY, const double theZ) = 0;
/// Defines the point
GEOMDATAAPI_EXPORT virtual void setValue(const std::shared_ptr<GeomAPI_Pnt>& thePoint) = 0;
GEOMDATAAPI_EXPORT virtual std::shared_ptr<GeomAPI_Pnt> pnt() = 0;
/// Defines the calculated double value
- GEOMDATAAPI_EXPORT virtual void setCalculatedValue(const double theX, const double theY, const double theZ) = 0;
+ GEOMDATAAPI_EXPORT virtual
+ void setCalculatedValue(const double theX, const double theY, const double theZ) = 0;
/// Defines the text values
GEOMDATAAPI_EXPORT virtual void setText(const std::string& theX,
GEOMDATAAPI_EXPORT virtual bool expressionInvalid(int theComponent) = 0;
/// Allows to set expression (text) error (by the parameters listener)
- GEOMDATAAPI_EXPORT virtual void setExpressionError(int theComponent, const std::string& theError) = 0;
+ GEOMDATAAPI_EXPORT virtual
+ void setExpressionError(int theComponent, const std::string& theError) = 0;
/// Returns an expression error
GEOMDATAAPI_EXPORT virtual std::string expressionError(int theComponent) = 0;
GEOMDATAAPI_EXPORT virtual bool expressionInvalid(int theComponent) = 0;
/// Allows to set expression (text) error (by the parameters listener)
- GEOMDATAAPI_EXPORT virtual void setExpressionError(int theComponent, const std::string& theError) = 0;
+ GEOMDATAAPI_EXPORT virtual
+ void setExpressionError(int theComponent, const std::string& theError) = 0;
/// Returns an expression error
GEOMDATAAPI_EXPORT virtual std::string expressionError(int theComponent) = 0;
return false;
}
- ResultConstructionPtr aResultConstruction = std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aContext);
+ ResultConstructionPtr aResultConstruction =
+ std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aContext);
if(aResultConstruction.get()) {
theError = "Error: Result construction selected.";
return false;
}
//=================================================================================================
-bool GeomValidators_BooleanArguments::isNotObligatory(std::string theFeature, std::string theAttribute)
+bool GeomValidators_BooleanArguments::isNotObligatory(std::string theFeature,
+ std::string theAttribute)
{
if(theAttribute == "main_objects" || theAttribute == "tool_objects") {
return true;
Events_InfoMessage& theError) const;
/// \return true if the attribute in feature is not obligatory for the feature execution.
- GEOMVALIDATORS_EXPORT virtual bool isNotObligatory(std::string theFeature, std::string theAttribute);
+ GEOMVALIDATORS_EXPORT virtual
+ bool isNotObligatory(std::string theFeature, std::string theAttribute);
};
#endif
}
// Search differences inside each attribute list
- std::map<std::string, std::list<AttributePtr> >::const_iterator anAttributesMapIt = anAttributesMap.begin();
+ std::map<std::string, std::list<AttributePtr> >::const_iterator
+ anAttributesMapIt = anAttributesMap.begin();
for (; anAttributesMapIt != anAttributesMap.end(); ++anAttributesMapIt) {
const std::list<AttributePtr>& anAttributes = anAttributesMapIt->second;
// for the list of attributes check that all elements are unique
std::list<AttributePtr>::const_iterator aFindIt =
std::find_if(aNextIt, anAttributes.end(), IsEqual(*anAttributeIt));
if (aFindIt != anAttributes.end()) {
- theError = "Attributes " + (*anAttributeIt)->id() + " and " + (*aFindIt)->id() + " are equal." ;
+ theError = "Attributes " + (*anAttributeIt)->id() + " and " +
+ (*aFindIt)->id() + " are equal." ;
return false;
}
++anAttributeIt;
const std::list<std::string>& theArguments,
Events_InfoMessage& theError) const;
- GEOMVALIDATORS_EXPORT virtual bool isNotObligatory(std::string theFeature, std::string theAttribute);
+ GEOMVALIDATORS_EXPORT virtual
+ bool isNotObligatory(std::string theFeature, std::string theAttribute);
};
#endif
const std::string anAttributeType = theAttribute->attributeType();
if(anAttributeType == ModelAPI_AttributeSelection::typeId()) {
- AttributeSelectionPtr aSelectionAttr = std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(theAttribute);
+ AttributeSelectionPtr aSelectionAttr =
+ std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(theAttribute);
ResultPtr aResult = aSelectionAttr->context();
- ResultConstructionPtr aConstruction = std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aResult);
+ ResultConstructionPtr aConstruction =
+ std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aResult);
if (aConstruction.get() && aConstruction->isInfinite()) {
aValid = false;
theError = "Infinite result is selected.";
AttributeSelectionPtr aSelectAttr = aSelectionListAttr->value(i);
ResultPtr aResult = aSelectAttr->context();
if (aResult.get() && aResult->groupName() == ModelAPI_ResultConstruction::group()) {
- ResultConstructionPtr aConstruction = std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aResult);
+ ResultConstructionPtr aConstruction =
+ std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aResult);
if (aConstruction.get() && aConstruction->isInfinite()) {
aValid = false;
theError = "Infinite result is selected.";
return false;
}
FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(theAttribute->owner());
- AttributeSelectionListPtr anAttrSelectionList = std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
+ AttributeSelectionListPtr anAttrSelectionList =
+ std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
for(int anIndex = 0; anIndex < anAttrSelectionList->size(); ++anIndex) {
AttributeSelectionPtr anAttrSelection = anAttrSelectionList->value(anIndex);
if(!anAttrSelection.get()) {
Events_InfoMessage& theError) const
{
if(theArguments.size() != 2) {
- theError = "Error: Wrong number of arguments (expected 2): selection list id and min number of objects";
+ theError =
+ "Error: Wrong number of arguments (expected 2): selection list id and min number of objects";
return false;
}
return true;
}
-//=================================================================================================
-bool GeomValidators_MinObjectsSelected::isNotObligatory(std::string theFeature, std::string theAttribute)
+//================================================================================================
+bool GeomValidators_MinObjectsSelected::isNotObligatory(std::string theFeature,
+ std::string theAttribute)
{
return false;
}
Events_InfoMessage& theError) const;
/// \return true if the attribute in feature is not obligatory for the feature execution.
- GEOMVALIDATORS_EXPORT virtual bool isNotObligatory(std::string theFeature, std::string theAttribute);
+ GEOMVALIDATORS_EXPORT virtual bool isNotObligatory(std::string theFeature,
+ std::string theAttribute);
};
#endif
isCombine = anAttrBool->value();
}
- if((anObjectsNb > 0 && aToolsNb > 0) || (isCombine && anObjectsNb != 0 && (anObjectsNb + aToolsNb > 1))) {
+ if((anObjectsNb > 0 && aToolsNb > 0) ||
+ (isCombine && anObjectsNb != 0 && (anObjectsNb + aToolsNb > 1))) {
return true;
}
}
//=================================================================================================
-bool GeomValidators_PartitionArguments::isNotObligatory(std::string theFeature, std::string theAttribute)
+bool GeomValidators_PartitionArguments::isNotObligatory(std::string theFeature,
+ std::string theAttribute)
{
if(theAttribute == "tool_objects") {
return true;
Events_InfoMessage& theError) const;
/// \return true if the attribute in feature is not obligatory for the feature execution.
- GEOMVALIDATORS_EXPORT virtual bool isNotObligatory(std::string theFeature, std::string theAttribute);
+ GEOMVALIDATORS_EXPORT virtual
+ bool isNotObligatory(std::string theFeature, std::string theAttribute);
};
#endif
ModelAPI_ValidatorsFactory* aFactory = aMgr->validators();
aFactory->registerValidator("GeomValidators_BodyShapes", new GeomValidators_BodyShapes);
- aFactory->registerValidator("GeomValidators_BooleanArguments", new GeomValidators_BooleanArguments);
- aFactory->registerValidator("GeomValidators_ConstructionComposite", new GeomValidators_ConstructionComposite);
+ aFactory->registerValidator("GeomValidators_BooleanArguments",
+ new GeomValidators_BooleanArguments);
+ aFactory->registerValidator("GeomValidators_ConstructionComposite",
+ new GeomValidators_ConstructionComposite);
aFactory->registerValidator("GeomValidators_Different", new GeomValidators_Different);
- aFactory->registerValidator("GeomValidators_DifferentShapes", new GeomValidators_DifferentShapes);
+ aFactory->registerValidator("GeomValidators_DifferentShapes",
+ new GeomValidators_DifferentShapes);
aFactory->registerValidator("GeomValidators_Face", new GeomValidators_Face);
aFactory->registerValidator("GeomValidators_Finite", new GeomValidators_Finite);
- aFactory->registerValidator("GeomValidators_PartitionArguments", new GeomValidators_PartitionArguments);
+ aFactory->registerValidator("GeomValidators_PartitionArguments",
+ new GeomValidators_PartitionArguments);
aFactory->registerValidator("GeomValidators_ShapeType", new GeomValidators_ShapeType);
aFactory->registerValidator("GeomValidators_ZeroOffset", new GeomValidators_ZeroOffset);
- aFactory->registerValidator("GeomValidators_IntersectionSelection", new GeomValidators_IntersectionSelection);
+ aFactory->registerValidator("GeomValidators_IntersectionSelection",
+ new GeomValidators_IntersectionSelection);
aFactory->registerValidator("GeomValidators_FeatureKind", new GeomValidators_FeatureKind);
- aFactory->registerValidator("GeomValidators_MinObjectsSelected", new GeomValidators_MinObjectsSelected);
+ aFactory->registerValidator("GeomValidators_MinObjectsSelected",
+ new GeomValidators_MinObjectsSelected);
// register this plugin
ModelAPI_Session::get()->registerPlugin(this);
typedef std::map<std::string, GeomValidators_ShapeType::TypeOfShape> EdgeTypes;
static EdgeTypes MyShapeTypes;
-GeomValidators_ShapeType::TypeOfShape GeomValidators_ShapeType::shapeType(const std::string& theType)
+GeomValidators_ShapeType::TypeOfShape
+ GeomValidators_ShapeType::shapeType(const std::string& theType)
{
if (MyShapeTypes.size() == 0) {
MyShapeTypes["empty"] = Empty;
std::string aValue = "";
if (MyShapeTypes.size() != 0) {
- std::map<std::string, GeomValidators_ShapeType::TypeOfShape>::const_iterator anIt = MyShapeTypes.begin(),
- aLast = MyShapeTypes.end();
+ std::map<std::string, GeomValidators_ShapeType::TypeOfShape>::const_iterator
+ anIt = MyShapeTypes.begin(), aLast = MyShapeTypes.end();
for (; anIt != aLast; anIt++) {
if (anIt->second == theType)
aValue = anIt->first;
if (!aTypes.empty())
aTypes += ", ";
}
- theError = "It does not contain element with acceptable shape type. The type should be one of the next: %1";
+ theError = "It does not contain element with acceptable shape type. \
+ The type should be one of the next: %1";
theError.arg(aTypes);
}
std::string anAttributeType = theAttribute->attributeType();
if (anAttributeType == ModelAPI_AttributeSelection::typeId()) {
- AttributeSelectionPtr anAttr = std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(theAttribute);
+ AttributeSelectionPtr anAttr =
+ std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(theAttribute);
GeomShapePtr aShape = anAttr->value();
if (aShape.get())
aValid = isValidShape(aShape, theShapeType, theError);
ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(theObject);
if( theShapeType==Plane )
{
- ResultConstructionPtr aResultConstruction = std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(theObject);
+ ResultConstructionPtr aResultConstruction =
+ std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(theObject);
FeaturePtr aFeature = ModelAPI_Feature::feature(theObject);
const std::string& aKind = aFeature->getKind();
return aResult.get() != NULL && aKind == "Plane";
ObjectPtr anObject;
std::string anAttrType = theAttribute->attributeType();
if (anAttrType == ModelAPI_AttributeRefAttr::typeId()) {
- AttributeRefAttrPtr anAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(theAttribute);
+ AttributeRefAttrPtr anAttr =
+ std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(theAttribute);
if (anAttr != NULL && anAttr->isObject())
anObject = anAttr->object();
}
if (anAttrType == ModelAPI_AttributeSelection::typeId()) {
- AttributeSelectionPtr anAttr = std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(theAttribute);
+ AttributeSelectionPtr anAttr =
+ std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(theAttribute);
if (anAttr != NULL)
anObject = anAttr->context();
}
if (anAttrType == ModelAPI_AttributeReference::typeId()) {
- AttributeReferencePtr anAttr = std::dynamic_pointer_cast<ModelAPI_AttributeReference>(theAttribute);
+ AttributeReferencePtr anAttr =
+ std::dynamic_pointer_cast<ModelAPI_AttributeReference>(theAttribute);
if (anAttr.get() != NULL)
anObject = anAttr->value();
}
ListOfShape aFacesList;
if(theFeature->selection(*anIt)) {
AttributeSelectionPtr aFaceSelection = theFeature->selection(*anIt);
- ResultConstructionPtr aConstruction = std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aFaceSelection->context());
+ ResultConstructionPtr aConstruction =
+ std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aFaceSelection->context());
if(aConstruction.get()) {
int aSketchFacesNum = aConstruction->facesNum();
for(int aFaceIndex = 0; aFaceIndex < aSketchFacesNum; aFaceIndex++) {
- std::shared_ptr<GeomAPI_Shape> aFace = std::dynamic_pointer_cast<GeomAPI_Shape>(aConstruction->face(aFaceIndex));
+ std::shared_ptr<GeomAPI_Shape> aFace =
+ std::dynamic_pointer_cast<GeomAPI_Shape>(aConstruction->face(aFaceIndex));
if(aFace->isFace() && aFace->isPlanar()) {
aFacesList.push_back(aFace);
}
if(!aContextShape.get()) {
break;
}
- ResultConstructionPtr aConstruction = std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aContext);
+ ResultConstructionPtr aConstruction =
+ std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aContext);
if(!aConstruction.get()) {
break;
}
}
std::shared_ptr<GeomAPI_Pln> aPln = aFace->getPlane();
if(aPln.get()) {
- for(ListOfShape::const_iterator anIter = aFacesList.cbegin(); anIter != aFacesList.cend(); anIter++) {
+ for(ListOfShape::const_iterator
+ anIter = aFacesList.cbegin(); anIter != aFacesList.cend(); anIter++) {
std::shared_ptr<GeomAPI_Shape> aSketchShape = *anIter;
std::shared_ptr<GeomAPI_Face> aSketchFace(new GeomAPI_Face(aSketchShape));
std::shared_ptr<GeomAPI_Pln> aSketchPln = aSketchFace->getPlane();
Events_InfoMessage& theError) const;
/// \return true if the attribute in feature is not obligatory for the feature execution.
- GEOMVALIDATORS_EXPORT virtual bool isNotObligatory(std::string theFeature, std::string theAttribute);
+ GEOMVALIDATORS_EXPORT virtual
+ bool isNotObligatory(std::string theFeature, std::string theAttribute);
};
#endif
} else if (theZ) {
aPlane->data()->setName("XOY");
}
- aPlane->setInHistory(aPlane, false); // don't show automatically created feature in the features history
+ // don't show automatically created feature in the features history
+ aPlane->setInHistory(aPlane, false);
// the plane should be executed in order to build the feature result immediatelly
// the results are to be hidden in the plugin
aPoint->real("y")->setValue(theY);
aPoint->real("z")->setValue(theZ);
aPoint->data()->setName(theName);
- aPoint->setInHistory(aPoint, false); // don't show automatically created feature in the features history
+ // don't show automatically created feature in the features history
+ aPoint->setInHistory(aPoint, false);
// the point should be executed in order to build the feature result immediatelly
// the results are to be hidden in the plugin
} else if (theZ != 0) {
aAxis->data()->setName("OZ");
}
- aAxis->setInHistory(aAxis, false); // don't show automatically created feature in the features history
+ // don't show automatically created feature in the features history
+ aAxis->setInHistory(aAxis, false);
aAxis->execute();
aAxis->data()->execState(ModelAPI_StateDone);
aAxis->firstResult()->data()->execState(ModelAPI_StateDone);