#include <ModelHighAPI_Selection.h>
#include <ModelHighAPI_Tools.h>
-//==================================================================================================
+//================================================================================================
SketchAPI_Arc::SketchAPI_Arc(const std::shared_ptr<ModelAPI_Feature> & theFeature)
: SketchAPI_SketchEntity(theFeature)
{
initialize();
}
-//==================================================================================================
+//================================================================================================
SketchAPI_Arc::SketchAPI_Arc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
double theCenterX, double theCenterY,
double theStartX, double theStartY,
: SketchAPI_SketchEntity(theFeature)
{
if(initialize()) {
- setByCenterStartEnd(theCenterX, theCenterY, theStartX, theStartY, theEndX, theEndY, theInversed);
+ setByCenterStartEnd(theCenterX, theCenterY, theStartX,
+ theStartY, theEndX, theEndY, theInversed);
}
}
-//==================================================================================================
+//================================================================================================
SketchAPI_Arc::SketchAPI_Arc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
}
}
-//==================================================================================================
+//================================================================================================
SketchAPI_Arc::SketchAPI_Arc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
double theStartX, double theStartY,
double theEndX, double theEndY,
}
}
-//==================================================================================================
+//===============================================================================================
SketchAPI_Arc::SketchAPI_Arc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
}
}
-//==================================================================================================
+//================================================================================================
SketchAPI_Arc::SketchAPI_Arc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const ModelHighAPI_RefAttr& theTangentPoint,
double theEndX, double theEndY,
}
}
-//==================================================================================================
+//================================================================================================
SketchAPI_Arc::SketchAPI_Arc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const ModelHighAPI_RefAttr& theTangentPoint,
const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
}
}
-//==================================================================================================
+//================================================================================================
SketchAPI_Arc::SketchAPI_Arc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const ModelHighAPI_Selection& theExternal)
: SketchAPI_SketchEntity(theFeature)
}
}
-//==================================================================================================
+//================================================================================================
SketchAPI_Arc::SketchAPI_Arc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::string& theExternalName)
: SketchAPI_SketchEntity(theFeature)
}
}
-//==================================================================================================
+//================================================================================================
SketchAPI_Arc::~SketchAPI_Arc()
{
}
-//==================================================================================================
+//================================================================================================
void SketchAPI_Arc::setByCenterStartEnd(double theCenterX, double theCenterY,
double theStartX, double theStartY,
double theEndX, double theEndY,
execute();
}
-//==================================================================================================
+//================================================================================================
void SketchAPI_Arc::setByCenterStartEnd(const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
execute();
}
-//==================================================================================================
+//================================================================================================
void SketchAPI_Arc::setByStartEndPassed(double theStartX, double theStartY,
double theEndX, double theEndY,
double thePassedX, double thePassedY)
execute();
}
-//==================================================================================================
+//================================================================================================
void SketchAPI_Arc::setByStartEndPassed(const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
const std::shared_ptr<GeomAPI_Pnt2d>& thePassed)
execute();
}
-//==================================================================================================
+//================================================================================================
void SketchAPI_Arc::setByTangent(const ModelHighAPI_RefAttr& theTangentPoint,
double theEndX, double theEndY,
bool theInversed)
execute();
}
-//==================================================================================================
+//================================================================================================
void SketchAPI_Arc::setByTangent(const ModelHighAPI_RefAttr& theTangentPoint,
const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
bool theInversed)
execute();
}
-//==================================================================================================
+//================================================================================================
void SketchAPI_Arc::setByExternal(const ModelHighAPI_Selection & theExternal)
{
fillAttribute(theExternal, external());
execute();
}
-//==================================================================================================
+//===============================================================================================
void SketchAPI_Arc::setByExternalName(const std::string & theExternalName)
{
fillAttribute(ModelHighAPI_Selection("EDGE", theExternalName), external());
execute();
}
-//==================================================================================================
+//===============================================================================================
void SketchAPI_Arc::setRadius(double theRadius)
{
fillAttribute(ModelHighAPI_Double(theRadius), myradius);
execute();
}
-//==================================================================================================
+//================================================================================================
void SketchAPI_Arc::setAngle(double theAngle)
{
fillAttribute(ModelHighAPI_Double(theAngle), myangle);
execute();
}
-//==================================================================================================
+//================================================================================================
void SketchAPI_Arc::dump(ModelHighAPI_Dumper& theDumper) const
{
if (isCopy())
virtual ~SketchAPI_Arc();
INTERFACE_10(SketchPlugin_Arc::ID(),
- arcType, SketchPlugin_Arc::ARC_TYPE(), ModelAPI_AttributeString, /** Arc type */,
- center, SketchPlugin_Arc::CENTER_ID(), GeomDataAPI_Point2D, /** Center point */,
- startPoint, SketchPlugin_Arc::START_ID(), GeomDataAPI_Point2D, /** Start point */,
- endPoint, SketchPlugin_Arc::END_ID(), GeomDataAPI_Point2D, /** End point */,
- inversed, SketchPlugin_Arc::INVERSED_ID(), ModelAPI_AttributeBoolean, /** Inversed flag */,
- passedPoint, SketchPlugin_Arc::PASSED_POINT_ID(), GeomDataAPI_Point2D, /** Passed point */,
- tangentPoint, SketchPlugin_Arc::TANGENT_POINT_ID(), ModelAPI_AttributeRefAttr, /** Tangent point */,
- radius, SketchPlugin_Arc::RADIUS_ID(), ModelAPI_AttributeDouble, /** Radius */,
- angle, SketchPlugin_Arc::ANGLE_ID(), ModelAPI_AttributeDouble, /** Angle */,
- external, SketchPlugin_Arc::EXTERNAL_ID(), ModelAPI_AttributeSelection, /** External */)
+ arcType, SketchPlugin_Arc::ARC_TYPE(),
+ ModelAPI_AttributeString, /** Arc type */,
+ center, SketchPlugin_Arc::CENTER_ID(),
+ GeomDataAPI_Point2D, /** Center point */,
+ startPoint, SketchPlugin_Arc::START_ID(),
+ GeomDataAPI_Point2D, /** Start point */,
+ endPoint, SketchPlugin_Arc::END_ID(),
+ GeomDataAPI_Point2D, /** End point */,
+ inversed, SketchPlugin_Arc::INVERSED_ID(),
+ ModelAPI_AttributeBoolean, /** Inversed flag */,
+ passedPoint, SketchPlugin_Arc::PASSED_POINT_ID(),
+ GeomDataAPI_Point2D, /** Passed point */,
+ tangentPoint, SketchPlugin_Arc::TANGENT_POINT_ID(),
+ ModelAPI_AttributeRefAttr, /** Tangent point */,
+ radius, SketchPlugin_Arc::RADIUS_ID(),
+ ModelAPI_AttributeDouble, /** Radius */,
+ angle, SketchPlugin_Arc::ANGLE_ID(),
+ ModelAPI_AttributeDouble, /** Angle */,
+ external, SketchPlugin_Arc::EXTERNAL_ID(),
+ ModelAPI_AttributeSelection, /** External */)
/// Set by center and start, end point.
SKETCHAPI_EXPORT
virtual ~SketchAPI_Circle();
INTERFACE_7(SketchPlugin_Circle::ID(),
- circleType, SketchPlugin_Circle::CIRCLE_TYPE(), ModelAPI_AttributeString, /** Circle type */,
- center, SketchPlugin_Circle::CENTER_ID(), GeomDataAPI_Point2D, /** Center point */,
- radius, SketchPlugin_Circle::RADIUS_ID(), ModelAPI_AttributeDouble, /** Radius */,
- firstPoint, SketchPlugin_Circle::FIRST_POINT_ID(), GeomDataAPI_Point2D, /** First point */,
- secondPoint, SketchPlugin_Circle::SECOND_POINT_ID(), GeomDataAPI_Point2D, /** Second point */,
- thirdPoint, SketchPlugin_Circle::THIRD_POINT_ID(), GeomDataAPI_Point2D, /** Third point */,
- external, SketchPlugin_Circle::EXTERNAL_ID(), ModelAPI_AttributeSelection, /** External */)
+ circleType, SketchPlugin_Circle::CIRCLE_TYPE(),
+ ModelAPI_AttributeString, /** Circle type */,
+ center, SketchPlugin_Circle::CENTER_ID(),
+ GeomDataAPI_Point2D, /** Center point */,
+ radius, SketchPlugin_Circle::RADIUS_ID(),
+ ModelAPI_AttributeDouble, /** Radius */,
+ firstPoint, SketchPlugin_Circle::FIRST_POINT_ID(),
+ GeomDataAPI_Point2D, /** First point */,
+ secondPoint, SketchPlugin_Circle::SECOND_POINT_ID(),
+ GeomDataAPI_Point2D, /** Second point */,
+ thirdPoint, SketchPlugin_Circle::THIRD_POINT_ID(),
+ GeomDataAPI_Point2D, /** Third point */,
+ external, SketchPlugin_Circle::EXTERNAL_ID(),
+ ModelAPI_AttributeSelection, /** External */)
/// Set by center and radius.
SKETCHAPI_EXPORT
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
// Name : SketchAPI_Constraint.cpp
// Purpose:
//
FeaturePtr aFeature = ModelAPI_Feature::feature(aRefAttr->object());
if (!aFeature)
return;
- AttributeSelectionPtr aAttr = aFeature->data()->selection(SketchPlugin_SketchEntity::EXTERNAL_ID());
+ AttributeSelectionPtr aAttr =
+ aFeature->data()->selection(SketchPlugin_SketchEntity::EXTERNAL_ID());
if (aAttr && aAttr->context().get() != NULL && !aAttr->isInvalid())
return;
}
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
// Name : SketchAPI_Constraint.h
// Purpose:
//
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
// Name : SketchAPI_IntersectionPoint.cpp
// Purpose:
//
const std::string& aSketchName = theDumper.parentName(aBase);
AttributeSelectionPtr aLine = externalLine();
- theDumper << aBase << " = " << aSketchName << ".addIntersectionPoint(" << aLine << ")" << std::endl;
+ theDumper << aBase << " = " <<
+ aSketchName << ".addIntersectionPoint(" << aLine << ")" << std::endl;
// dump "auxiliary" flag if necessary
SketchAPI_SketchEntity::dump(theDumper);
}
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
// Name : SketchAPI_IntersectionPoint.h
// Purpose:
//
virtual ~SketchAPI_IntersectionPoint();
INTERFACE_2(SketchPlugin_IntersectionPoint::ID(),
- coordinates, SketchPlugin_IntersectionPoint::COORD_ID(), GeomDataAPI_Point2D, /** IntersectionPoint coordinates */,
- externalLine, SketchPlugin_IntersectionPoint::EXTERNAL_LINE_ID(), ModelAPI_AttributeSelection, /** External line */
+ coordinates, SketchPlugin_IntersectionPoint::COORD_ID(),
+ GeomDataAPI_Point2D, /** IntersectionPoint coordinates */,
+ externalLine, SketchPlugin_IntersectionPoint::EXTERNAL_LINE_ID(),
+ ModelAPI_AttributeSelection, /** External line */
)
/// Set by external
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
// Name : SketchAPI_Line.cpp
// Purpose:
//
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
// Name : SketchAPI_Line.h
// Purpose:
//
virtual ~SketchAPI_Line();
INTERFACE_3(SketchPlugin_Line::ID(),
- startPoint, SketchPlugin_Line::START_ID(), GeomDataAPI_Point2D, /** Start point */,
- endPoint, SketchPlugin_Line::END_ID(), GeomDataAPI_Point2D, /** End point */,
- external, SketchPlugin_Line::EXTERNAL_ID(), ModelAPI_AttributeSelection, /** External */
+ startPoint, SketchPlugin_Line::START_ID(),
+ GeomDataAPI_Point2D, /** Start point */,
+ endPoint, SketchPlugin_Line::END_ID(),
+ GeomDataAPI_Point2D, /** End point */,
+ external, SketchPlugin_Line::EXTERNAL_ID(),
+ ModelAPI_AttributeSelection, /** External */
)
/// Set by coordinates
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
// Name : SketchAPI_Mirror.cpp
// Purpose:
//
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
// Name : SketchAPI_Mirror.h
// Purpose:
//
virtual ~SketchAPI_Mirror();
INTERFACE_4(SketchPlugin_ConstraintMirror::ID(),
- mirrorLine, SketchPlugin_ConstraintMirror::ENTITY_A(), ModelAPI_AttributeRefAttr, /** Mirror line */,
- mirrorList, SketchPlugin_ConstraintMirror::MIRROR_LIST_ID(), ModelAPI_AttributeRefList, /** Mirror list */,
- referenceObjects, SketchPlugin_ConstraintMirror::ENTITY_B(), ModelAPI_AttributeRefList, /** Reference objects */,
- mirroredObjects, SketchPlugin_ConstraintMirror::ENTITY_C(), ModelAPI_AttributeRefList, /** Mirrored objects */
+ mirrorLine, SketchPlugin_ConstraintMirror::ENTITY_A(),
+ ModelAPI_AttributeRefAttr, /** Mirror line */,
+ mirrorList, SketchPlugin_ConstraintMirror::MIRROR_LIST_ID(),
+ ModelAPI_AttributeRefList, /** Mirror list */,
+ referenceObjects, SketchPlugin_ConstraintMirror::ENTITY_B(),
+ ModelAPI_AttributeRefList, /** Reference objects */,
+ mirroredObjects, SketchPlugin_ConstraintMirror::ENTITY_C(),
+ ModelAPI_AttributeRefList, /** Mirrored objects */
)
/// List of mirrored objects
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
// Name : SketchAPI_Point.cpp
// Purpose:
//
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
// Name : SketchAPI_Point.h
// Purpose:
//
virtual ~SketchAPI_Point();
INTERFACE_2(SketchPlugin_Point::ID(),
- coordinates, SketchPlugin_Point::COORD_ID(), GeomDataAPI_Point2D, /** Point coordinates */,
- external, SketchPlugin_Point::EXTERNAL_ID(), ModelAPI_AttributeSelection, /** External */
+ coordinates, SketchPlugin_Point::COORD_ID(),
+ GeomDataAPI_Point2D, /** Point coordinates */,
+ external, SketchPlugin_Point::EXTERNAL_ID(),
+ ModelAPI_AttributeSelection, /** External */
)
/// Set by coordinates
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
// Name : SketchAPI_Projection.cpp
// Purpose:
//
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
// Name : SketchAPI_Projection.h
// Purpose:
//
virtual ~SketchAPI_Projection();
INTERFACE_3(SketchPlugin_Projection::ID(),
- externalFeature, SketchPlugin_Projection::EXTERNAL_FEATURE_ID(), ModelAPI_AttributeSelection, /** External feature */,
- projectedFeature, SketchPlugin_Projection::PROJECTED_FEATURE_ID(), ModelAPI_AttributeRefAttr, /** Projected feature */,
- external, SketchPlugin_Projection::EXTERNAL_ID(), ModelAPI_AttributeSelection, /** External */
+ externalFeature, SketchPlugin_Projection::EXTERNAL_FEATURE_ID(),
+ ModelAPI_AttributeSelection, /** External feature */,
+ projectedFeature, SketchPlugin_Projection::PROJECTED_FEATURE_ID(),
+ ModelAPI_AttributeRefAttr, /** Projected feature */,
+ external, SketchPlugin_Projection::EXTERNAL_ID(),
+ ModelAPI_AttributeSelection, /** External */
)
/// Set external feature
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
// Name : SketchAPI_Rectangle.cpp
// Purpose:
//
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
// Name : SketchAPI_Rectangle.h
// Purpose:
//
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
// Name : SketchAPI_Rotation.cpp
// Purpose:
//
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
// Name : SketchAPI_Rotation.h
// Purpose:
//
virtual ~SketchAPI_Rotation();
INTERFACE_7(SketchPlugin_MultiRotation::ID(),
- rotationList, SketchPlugin_MultiRotation::ROTATION_LIST_ID(), ModelAPI_AttributeRefList, /** Rotation list */,
- center, SketchPlugin_MultiRotation::CENTER_ID(), ModelAPI_AttributeRefAttr, /** Center */,
- angle, SketchPlugin_MultiRotation::ANGLE_ID(), ModelAPI_AttributeDouble, /** Angle */,
- numberOfObjects, SketchPlugin_MultiRotation::NUMBER_OF_OBJECTS_ID(), ModelAPI_AttributeInteger, /** Number of objects */,
- valueType, SketchPlugin_MultiRotation::ANGLE_TYPE(), ModelAPI_AttributeString, /** Value type */,
- referenceObjects, SketchPlugin_MultiRotation::ENTITY_A(), ModelAPI_AttributeRefList, /** Reference objects */,
- rotatedObjects, SketchPlugin_MultiRotation::ENTITY_B(), ModelAPI_AttributeRefList, /** Rotated objects */
+ rotationList, SketchPlugin_MultiRotation::ROTATION_LIST_ID(),
+ ModelAPI_AttributeRefList, /** Rotation list */,
+ center, SketchPlugin_MultiRotation::CENTER_ID(),
+ ModelAPI_AttributeRefAttr, /** Center */,
+ angle, SketchPlugin_MultiRotation::ANGLE_ID(),
+ ModelAPI_AttributeDouble, /** Angle */,
+ numberOfObjects, SketchPlugin_MultiRotation::NUMBER_OF_OBJECTS_ID(),
+ ModelAPI_AttributeInteger, /** Number of objects */,
+ valueType, SketchPlugin_MultiRotation::ANGLE_TYPE(),
+ ModelAPI_AttributeString, /** Value type */,
+ referenceObjects, SketchPlugin_MultiRotation::ENTITY_A(),
+ ModelAPI_AttributeRefList, /** Reference objects */,
+ rotatedObjects, SketchPlugin_MultiRotation::ENTITY_B(),
+ ModelAPI_AttributeRefList, /** Rotated objects */
)
/// List of rotated objects
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
// Name : SketchAPI_Sketch.cpp
// Purpose:
//
const std::shared_ptr<ModelHighAPI_Interface> & theConstraint,
const ModelHighAPI_Double & theValue)
{
- // TODO(spo): check somehow that the feature is a constraint or eliminate crash if the feature have no real attribute VALUE
+ // TODO(spo): check somehow that the feature is a constraint or eliminate
+ // crash if the feature have no real attribute VALUE
fillAttribute(theValue, theConstraint->feature()->real(SketchPlugin_Constraint::VALUE()));
// theConstraint->execute();
{
// TODO(spo): check that thePart is not empty
std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(SketchAPI_Sketch::ID());
- return SketchPtr(new SketchAPI_Sketch(aFeature, ModelHighAPI_Selection("FACE", theExternalName)));
+ return SketchPtr(
+ new SketchAPI_Sketch(aFeature, ModelHighAPI_Selection("FACE", theExternalName)));
}
SketchPtr addSketch(const std::shared_ptr<ModelAPI_Document> & thePart,
std::shared_ptr<SketchAPI_Point> SketchAPI_Sketch::addPoint(
double theX, double theY)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Point::ID());
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ compositeFeature()->addFeature(SketchPlugin_Point::ID());
return PointPtr(new SketchAPI_Point(aFeature, theX, theY));
}
std::shared_ptr<SketchAPI_Point> SketchAPI_Sketch::addPoint(
const std::shared_ptr<GeomAPI_Pnt2d> & thePoint)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Point::ID());
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ compositeFeature()->addFeature(SketchPlugin_Point::ID());
return PointPtr(new SketchAPI_Point(aFeature, thePoint));
}
-std::shared_ptr<SketchAPI_Point> SketchAPI_Sketch::addPoint(const ModelHighAPI_Selection & theExternal)
+std::shared_ptr<SketchAPI_Point>
+ SketchAPI_Sketch::addPoint(const ModelHighAPI_Selection & theExternal)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Point::ID());
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ compositeFeature()->addFeature(SketchPlugin_Point::ID());
return PointPtr(new SketchAPI_Point(aFeature, theExternal));
}
std::shared_ptr<SketchAPI_Point> SketchAPI_Sketch::addPoint(const std::string & theExternalName)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Point::ID());
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ compositeFeature()->addFeature(SketchPlugin_Point::ID());
return PointPtr(new SketchAPI_Point(aFeature, theExternalName));
}
std::shared_ptr<SketchAPI_IntersectionPoint> SketchAPI_Sketch::addIntersectionPoint(
const ModelHighAPI_Selection & theExternal)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_IntersectionPoint::ID());
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ compositeFeature()->addFeature(SketchPlugin_IntersectionPoint::ID());
return IntersectionPointPtr(new SketchAPI_IntersectionPoint(aFeature, theExternal));
}
std::shared_ptr<SketchAPI_IntersectionPoint> SketchAPI_Sketch::addIntersectionPoint(
const std::string & theExternalName)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_IntersectionPoint::ID());
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ compositeFeature()->addFeature(SketchPlugin_IntersectionPoint::ID());
return IntersectionPointPtr(new SketchAPI_IntersectionPoint(aFeature, theExternalName));
}
//--------------------------------------------------------------------------------------
-std::shared_ptr<SketchAPI_Line> SketchAPI_Sketch::addLine(double theX1, double theY1, double theX2, double theY2)
+std::shared_ptr<SketchAPI_Line> SketchAPI_Sketch::addLine(double theX1, double theY1,
+ double theX2, double theY2)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Line::ID());
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ compositeFeature()->addFeature(SketchPlugin_Line::ID());
return LinePtr(new SketchAPI_Line(aFeature, theX1, theY1, theX2, theY2));
}
std::shared_ptr<SketchAPI_Line> SketchAPI_Sketch::addLine(
const std::shared_ptr<GeomAPI_Pnt2d> & theStartPoint,
const std::shared_ptr<GeomAPI_Pnt2d> & theEndPoint)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Line::ID());
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ compositeFeature()->addFeature(SketchPlugin_Line::ID());
return LinePtr(new SketchAPI_Line(aFeature, theStartPoint, theEndPoint));
}
-std::shared_ptr<SketchAPI_Line> SketchAPI_Sketch::addLine(const ModelHighAPI_Selection & theExternal)
+std::shared_ptr<SketchAPI_Line>
+ SketchAPI_Sketch::addLine(const ModelHighAPI_Selection & theExternal)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Line::ID());
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ compositeFeature()->addFeature(SketchPlugin_Line::ID());
return LinePtr(new SketchAPI_Line(aFeature, theExternal));
}
std::shared_ptr<SketchAPI_Line> SketchAPI_Sketch::addLine(const std::string & theExternalName)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Line::ID());
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ compositeFeature()->addFeature(SketchPlugin_Line::ID());
return LinePtr(new SketchAPI_Line(aFeature, theExternalName));
}
//--------------------------------------------------------------------------------------
-std::shared_ptr<SketchAPI_Rectangle> SketchAPI_Sketch::addRectangle(double theX1, double theY1, double theX2, double theY2)
+std::shared_ptr<SketchAPI_Rectangle> SketchAPI_Sketch::addRectangle(double theX1, double theY1,
+ double theX2, double theY2)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchAPI_Rectangle::ID());
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ compositeFeature()->addFeature(SketchAPI_Rectangle::ID());
return RectanglePtr(new SketchAPI_Rectangle(aFeature, theX1, theY1, theX2, theY2));
}
std::shared_ptr<SketchAPI_Rectangle> SketchAPI_Sketch::addRectangle(
const std::shared_ptr<GeomAPI_Pnt2d> & theStartPoint,
const std::shared_ptr<GeomAPI_Pnt2d> & theEndPoint)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchAPI_Rectangle::ID());
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ compositeFeature()->addFeature(SketchAPI_Rectangle::ID());
return RectanglePtr(new SketchAPI_Rectangle(aFeature, theStartPoint, theEndPoint));
}
double theCenterY,
double theRadius)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Circle::ID());
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ compositeFeature()->addFeature(SketchPlugin_Circle::ID());
return CirclePtr(new SketchAPI_Circle(aFeature, theCenterX, theCenterY, theRadius));
}
-std::shared_ptr<SketchAPI_Circle> SketchAPI_Sketch::addCircle(const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
- double theRadius)
+std::shared_ptr<SketchAPI_Circle> SketchAPI_Sketch::addCircle(
+ const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
+ double theRadius)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Circle::ID());
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ compositeFeature()->addFeature(SketchPlugin_Circle::ID());
return CirclePtr(new SketchAPI_Circle(aFeature, theCenter, theRadius));
}
double theX2, double theY2,
double theX3, double theY3)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Circle::ID());
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ compositeFeature()->addFeature(SketchPlugin_Circle::ID());
return CirclePtr(new SketchAPI_Circle(aFeature, theX1, theY1, theX2, theY2, theX3, theY3));
}
-std::shared_ptr<SketchAPI_Circle> SketchAPI_Sketch::addCircle(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint1,
- const std::shared_ptr<GeomAPI_Pnt2d>& thePoint2,
- const std::shared_ptr<GeomAPI_Pnt2d>& thePoint3)
+std::shared_ptr<SketchAPI_Circle> SketchAPI_Sketch::addCircle(
+ const std::shared_ptr<GeomAPI_Pnt2d>& thePoint1,
+ const std::shared_ptr<GeomAPI_Pnt2d>& thePoint2,
+ const std::shared_ptr<GeomAPI_Pnt2d>& thePoint3)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Circle::ID());
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ compositeFeature()->addFeature(SketchPlugin_Circle::ID());
return CirclePtr(new SketchAPI_Circle(aFeature, thePoint1, thePoint2, thePoint3));
}
-std::shared_ptr<SketchAPI_Circle> SketchAPI_Sketch::addCircle(const ModelHighAPI_Selection & theExternal)
+std::shared_ptr<SketchAPI_Circle>
+ SketchAPI_Sketch::addCircle(const ModelHighAPI_Selection & theExternal)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Circle::ID());
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ compositeFeature()->addFeature(SketchPlugin_Circle::ID());
return CirclePtr(new SketchAPI_Circle(aFeature, theExternal));
}
std::shared_ptr<SketchAPI_Circle> SketchAPI_Sketch::addCircle(const std::string & theExternalName)
{
// TODO(spo): Add constraint SketchConstraintRigid like in PythonAPI. Is it necessary?
- std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Circle::ID());
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ compositeFeature()->addFeature(SketchPlugin_Circle::ID());
return CirclePtr(new SketchAPI_Circle(aFeature, theExternalName));
}
double theEndX, double theEndY,
bool theInversed)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Arc::ID());
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ compositeFeature()->addFeature(SketchPlugin_Arc::ID());
return ArcPtr(new SketchAPI_Arc(aFeature,
theCenterX, theCenterY,
theStartX, theStartY,
theInversed));
}
-std::shared_ptr<SketchAPI_Arc> SketchAPI_Sketch::addArc(const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
- const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
- const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
- bool theInversed)
+std::shared_ptr<SketchAPI_Arc> SketchAPI_Sketch::addArc(
+ const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
+ const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
+ const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
+ bool theInversed)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Arc::ID());
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ compositeFeature()->addFeature(SketchPlugin_Arc::ID());
return ArcPtr(new SketchAPI_Arc(aFeature, theCenter, theStart, theEnd, theInversed));
}
double theEndX, double theEndY,
double thePassedX, double thePassedY)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Arc::ID());
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ compositeFeature()->addFeature(SketchPlugin_Arc::ID());
return ArcPtr(new SketchAPI_Arc(aFeature,
theStartX, theStartY,
theEndX, theEndY,
thePassedX, thePassedY));
}
-std::shared_ptr<SketchAPI_Arc> SketchAPI_Sketch::addArc(const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
- const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
- const std::shared_ptr<GeomAPI_Pnt2d>& thePassed)
+std::shared_ptr<SketchAPI_Arc> SketchAPI_Sketch::addArc(
+ const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
+ const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
+ const std::shared_ptr<GeomAPI_Pnt2d>& thePassed)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Arc::ID());
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ compositeFeature()->addFeature(SketchPlugin_Arc::ID());
return ArcPtr(new SketchAPI_Arc(aFeature, theStart, theEnd, thePassed));
}
-std::shared_ptr<SketchAPI_Arc> SketchAPI_Sketch::addArc(const ModelHighAPI_RefAttr& theTangentPoint,
- double theEndX, double theEndY,
- bool theInversed)
+std::shared_ptr<SketchAPI_Arc> SketchAPI_Sketch::addArc(
+ const ModelHighAPI_RefAttr& theTangentPoint,
+ double theEndX, double theEndY,
+ bool theInversed)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Arc::ID());
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ compositeFeature()->addFeature(SketchPlugin_Arc::ID());
return ArcPtr(new SketchAPI_Arc(aFeature, theTangentPoint, theEndX, theEndY, theInversed));
}
-std::shared_ptr<SketchAPI_Arc> SketchAPI_Sketch::addArc(const ModelHighAPI_RefAttr& theTangentPoint,
- const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
- bool theInversed)
+std::shared_ptr<SketchAPI_Arc> SketchAPI_Sketch::addArc(
+ const ModelHighAPI_RefAttr& theTangentPoint,
+ const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
+ bool theInversed)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Arc::ID());
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ compositeFeature()->addFeature(SketchPlugin_Arc::ID());
return ArcPtr(new SketchAPI_Arc(aFeature, theTangentPoint, theEnd, theInversed));
}
std::shared_ptr<SketchAPI_Arc> SketchAPI_Sketch::addArc(const ModelHighAPI_Selection & theExternal)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Arc::ID());
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ compositeFeature()->addFeature(SketchPlugin_Arc::ID());
return ArcPtr(new SketchAPI_Arc(aFeature, theExternal));
}
std::shared_ptr<SketchAPI_Arc> SketchAPI_Sketch::addArc(const std::string & theExternalName)
{
// TODO(spo): Add constraint SketchConstraintRigid like in PythonAPI. Is it necessary?
- std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Arc::ID());
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ compositeFeature()->addFeature(SketchPlugin_Arc::ID());
return ArcPtr(new SketchAPI_Arc(aFeature, theExternalName));
}
std::shared_ptr<SketchAPI_Projection> SketchAPI_Sketch::addProjection(
const ModelHighAPI_Selection & theExternalFeature)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Projection::ID());
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ compositeFeature()->addFeature(SketchPlugin_Projection::ID());
return ProjectionPtr(new SketchAPI_Projection(aFeature, theExternalFeature));
}
std::shared_ptr<SketchAPI_Projection> SketchAPI_Sketch::addProjection(
const std::string & theExternalName)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Projection::ID());
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ compositeFeature()->addFeature(SketchPlugin_Projection::ID());
return ProjectionPtr(new SketchAPI_Projection(aFeature, theExternalName));
}
const ModelHighAPI_RefAttr & theMirrorLine,
const std::list<std::shared_ptr<ModelAPI_Object> > & theObjects)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_ConstraintMirror::ID());
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ compositeFeature()->addFeature(SketchPlugin_ConstraintMirror::ID());
return MirrorPtr(new SketchAPI_Mirror(aFeature, theMirrorLine, theObjects));
}
const ModelHighAPI_Integer & theNumberOfObjects,
bool theFullValue)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_MultiTranslation::ID());
- return TranslationPtr(new SketchAPI_Translation(aFeature, theObjects, thePoint1, thePoint2, theNumberOfObjects, theFullValue));
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ compositeFeature()->addFeature(SketchPlugin_MultiTranslation::ID());
+ return TranslationPtr(new SketchAPI_Translation(aFeature, theObjects, thePoint1,
+ thePoint2, theNumberOfObjects, theFullValue));
}
//--------------------------------------------------------------------------------------
const ModelHighAPI_Integer & theNumberOfObjects,
bool theFullValue)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_MultiRotation::ID());
- return RotationPtr(new SketchAPI_Rotation(aFeature, theObjects, theCenter, theAngle, theNumberOfObjects, theFullValue));
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ compositeFeature()->addFeature(SketchPlugin_MultiRotation::ID());
+ return RotationPtr(
+ new SketchAPI_Rotation(aFeature, theObjects, theCenter,
+ theAngle, theNumberOfObjects, theFullValue));
}
//--------------------------------------------------------------------------------------
-std::shared_ptr<ModelHighAPI_Interface> SketchAPI_Sketch::addSplit(const ModelHighAPI_Reference& theFeature,
- const ModelHighAPI_RefAttr& thePoint1,
- const ModelHighAPI_RefAttr& thePoint2)
+std::shared_ptr<ModelHighAPI_Interface> SketchAPI_Sketch::addSplit(
+ const ModelHighAPI_Reference& theFeature,
+ const ModelHighAPI_RefAttr& thePoint1,
+ const ModelHighAPI_RefAttr& thePoint2)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_ConstraintSplit::ID());
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ compositeFeature()->addFeature(SketchPlugin_ConstraintSplit::ID());
fillAttribute(theFeature, aFeature->reference(SketchPlugin_Constraint::VALUE()));
fillAttribute(thePoint1, aFeature->refattr(SketchPlugin_Constraint::ENTITY_A()));
fillAttribute(thePoint2, aFeature->refattr(SketchPlugin_Constraint::ENTITY_B()));
AttributeSelectionPtr anExternal = aBase->selection(SketchPlugin_SketchEntity::EXTERNAL_ID());
if (anExternal->value()) {
- theDumper << aBase << " = model.addSketch(" << aDocName << ", " << anExternal << ")" << std::endl;
+ theDumper << aBase << " = model.addSketch(" << aDocName <<
+ ", " << anExternal << ")" << std::endl;
} else {
// Sketch is base on a plane.
std::shared_ptr<GeomAPI_Pnt> anOrigin = std::dynamic_pointer_cast<GeomDataAPI_Point>(
theDumper << aBase << " = model.addSketch(" << aDocName
<< ", model.standardPlane(\"" << aPlaneName << "\"))" << std::endl;
} else { // some other plane
- theDumper << aBase << " = model.addSketch(" << aDocName << ", " << anExternal<< ")" << std::endl;
+ theDumper << aBase << " = model.addSketch(" << aDocName <<
+ ", " << anExternal<< ")" << std::endl;
}
} else {
if (aPlaneName.empty()) {
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
// Name : SketchAPI_Sketch.h
// Purpose:
//
virtual ~SketchAPI_Sketch();
INTERFACE_7(SketchPlugin_Sketch::ID(),
- origin, SketchPlugin_Sketch::ORIGIN_ID(), GeomDataAPI_Point, /** Origin point */,
- dirX, SketchPlugin_Sketch::DIRX_ID(), GeomDataAPI_Dir, /** Direction of X */,
- normal, SketchPlugin_Sketch::NORM_ID(), GeomDataAPI_Dir, /** Normal */,
- features, SketchPlugin_Sketch::FEATURES_ID(), ModelAPI_AttributeRefList, /** Features */,
- external, SketchPlugin_SketchEntity::EXTERNAL_ID(), ModelAPI_AttributeSelection, /** External */,
- solverError, SketchPlugin_Sketch::SOLVER_ERROR(), ModelAPI_AttributeString, /** Solver error */,
- solverDOF, SketchPlugin_Sketch::SOLVER_DOF(), ModelAPI_AttributeString, /** Solver DOF */
+ origin, SketchPlugin_Sketch::ORIGIN_ID(),
+ GeomDataAPI_Point, /** Origin point */,
+ dirX, SketchPlugin_Sketch::DIRX_ID(),
+ GeomDataAPI_Dir, /** Direction of X */,
+ normal, SketchPlugin_Sketch::NORM_ID(),
+ GeomDataAPI_Dir, /** Normal */,
+ features, SketchPlugin_Sketch::FEATURES_ID(),
+ ModelAPI_AttributeRefList, /** Features */,
+ external, SketchPlugin_SketchEntity::EXTERNAL_ID(),
+ ModelAPI_AttributeSelection, /** External */,
+ solverError, SketchPlugin_Sketch::SOLVER_ERROR(),
+ ModelAPI_AttributeString, /** Solver error */,
+ solverDOF, SketchPlugin_Sketch::SOLVER_DOF(),
+ ModelAPI_AttributeString, /** Solver DOF */
)
/// Set plane
/// Add intersection point
SKETCHAPI_EXPORT
- std::shared_ptr<SketchAPI_IntersectionPoint> addIntersectionPoint(const ModelHighAPI_Selection & theExternal);
+ std::shared_ptr<SketchAPI_IntersectionPoint>
+ addIntersectionPoint(const ModelHighAPI_Selection & theExternal);
/// Add point
SKETCHAPI_EXPORT
- std::shared_ptr<SketchAPI_IntersectionPoint> addIntersectionPoint(const std::string & theExternalName);
+ std::shared_ptr<SketchAPI_IntersectionPoint>
+ addIntersectionPoint(const std::string & theExternalName);
/// Add line
SKETCHAPI_EXPORT
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
// Name : SketchAPI_SketchEntity.cpp
// Purpose:
//
else if ((*anIt)->getKind() == SketchPlugin_Point::ID())
aResult.push_back(std::shared_ptr<ModelHighAPI_Interface>(new SketchAPI_Point(*anIt)));
else if ((*anIt)->getKind() == SketchPlugin_IntersectionPoint::ID())
- aResult.push_back(std::shared_ptr<ModelHighAPI_Interface>(new SketchAPI_IntersectionPoint(*anIt)));
+ aResult.push_back(std::shared_ptr<ModelHighAPI_Interface>(
+ new SketchAPI_IntersectionPoint(*anIt)));
}
return aResult;
}
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
// Name : SketchAPI_SketchEntity.h
// Purpose:
//
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
// Name : SketchAPI_Translation.cpp
// Purpose:
//
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
// Name : SketchAPI_Translation.h
// Purpose:
//
virtual ~SketchAPI_Translation();
INTERFACE_7(SketchPlugin_MultiTranslation::ID(),
- translationList, SketchPlugin_MultiTranslation::TRANSLATION_LIST_ID(), ModelAPI_AttributeRefList, /** Translation list */,
- startPoint, SketchPlugin_MultiTranslation::START_POINT_ID(), ModelAPI_AttributeRefAttr, /** Start point */,
- endPoint, SketchPlugin_MultiTranslation::END_POINT_ID(), ModelAPI_AttributeRefAttr, /** Start point */,
- numberOfObjects, SketchPlugin_MultiTranslation::NUMBER_OF_OBJECTS_ID(), ModelAPI_AttributeInteger, /** Number of objects */,
- valueType, SketchPlugin_MultiTranslation::VALUE_TYPE(), ModelAPI_AttributeString, /** Value type */,
- referenceObjects, SketchPlugin_MultiTranslation::ENTITY_A(), ModelAPI_AttributeRefList, /** Reference objects */,
- translatedObjects, SketchPlugin_MultiTranslation::ENTITY_B(), ModelAPI_AttributeRefList, /** Translationed objects */
+ translationList, SketchPlugin_MultiTranslation::TRANSLATION_LIST_ID(),
+ ModelAPI_AttributeRefList, /** Translation list */,
+ startPoint, SketchPlugin_MultiTranslation::START_POINT_ID(),
+ ModelAPI_AttributeRefAttr, /** Start point */,
+ endPoint, SketchPlugin_MultiTranslation::END_POINT_ID(),
+ ModelAPI_AttributeRefAttr, /** Start point */,
+ numberOfObjects, SketchPlugin_MultiTranslation::NUMBER_OF_OBJECTS_ID(),
+ ModelAPI_AttributeInteger, /** Number of objects */,
+ valueType, SketchPlugin_MultiTranslation::VALUE_TYPE(),
+ ModelAPI_AttributeString, /** Value type */,
+ referenceObjects, SketchPlugin_MultiTranslation::ENTITY_A(),
+ ModelAPI_AttributeRefList, /** Reference objects */,
+ translatedObjects, SketchPlugin_MultiTranslation::ENTITY_B(),
+ ModelAPI_AttributeRefList, /** Translationed objects */
)
/// List of translated objects
if (!anAttr2->isInitialized())
return aReadyToDisplay;
- FeaturePtr aLineA = SketcherPrs_Tools::getFeatureLine(aData, SketchPlugin_Constraint::ENTITY_A());
- FeaturePtr aLineB = SketcherPrs_Tools::getFeatureLine(aData, SketchPlugin_Constraint::ENTITY_B());
+ FeaturePtr aLineA =
+ SketcherPrs_Tools::getFeatureLine(aData, SketchPlugin_Constraint::ENTITY_A());
+ FeaturePtr aLineB =
+ SketcherPrs_Tools::getFeatureLine(aData, SketchPlugin_Constraint::ENTITY_B());
if (!aLineA.get() || !aLineB.get())
return aReadyToDisplay;
aLineB->attribute(SketchPlugin_Line::END_ID()));
std::shared_ptr<GeomAPI_Angle2d> anAng;
- if (!aData->attribute(SketchPlugin_ConstraintAngle::ANGLE_REVERSED_FIRST_LINE_ID())->isInitialized() ||
- !aData->attribute(SketchPlugin_ConstraintAngle::ANGLE_REVERSED_SECOND_LINE_ID())->isInitialized())
+ bool isFirstPnt = aData->attribute(
+ SketchPlugin_ConstraintAngle::ANGLE_REVERSED_FIRST_LINE_ID())->isInitialized();
+ bool isSecondPnt = aData->attribute(
+ SketchPlugin_ConstraintAngle::ANGLE_REVERSED_SECOND_LINE_ID())->isInitialized();
+ if (!isFirstPnt || !isSecondPnt)
anAng = std::shared_ptr<GeomAPI_Angle2d>(new GeomAPI_Angle2d(
aStartA->pnt(), aEndA->pnt(), aStartB->pnt(), aEndB->pnt()));
else {
std::shared_ptr<GeomAPI_Lin2d> aLine1(new GeomAPI_Lin2d(aStartA->pnt(), aEndA->pnt()));
- bool isReversed1 = aData->boolean(SketchPlugin_ConstraintAngle::ANGLE_REVERSED_FIRST_LINE_ID())->value();
+ bool isReversed1 =
+ aData->boolean(SketchPlugin_ConstraintAngle::ANGLE_REVERSED_FIRST_LINE_ID())->value();
std::shared_ptr<GeomAPI_Lin2d> aLine2(new GeomAPI_Lin2d(aStartB->pnt(), aEndB->pnt()));
- bool isReversed2 = aData->boolean(SketchPlugin_ConstraintAngle::ANGLE_REVERSED_SECOND_LINE_ID())->value();
- anAng = std::shared_ptr<GeomAPI_Angle2d>(new GeomAPI_Angle2d(aLine1, isReversed1, aLine2, isReversed2));
+ bool isReversed2 =
+ aData->boolean(SketchPlugin_ConstraintAngle::ANGLE_REVERSED_SECOND_LINE_ID())->value();
+ anAng = std::shared_ptr<GeomAPI_Angle2d>(
+ new GeomAPI_Angle2d(aLine1, isReversed1, aLine2, isReversed2));
}
gp_Pnt2d aFirstPoint = anAng->firstPoint()->impl<gp_Pnt2d>();
const Standard_Integer theMode)
{
gp_Pnt aFirstPoint, aSecondPoint, aCenterPoint;
- bool aReadyToDisplay = readyToDisplay(myConstraint, mySketcherPlane, aFirstPoint, aSecondPoint, aCenterPoint);
+ bool aReadyToDisplay = readyToDisplay(myConstraint, mySketcherPlane,
+ aFirstPoint, aSecondPoint, aCenterPoint);
if (aReadyToDisplay) {
myFirstPoint = aFirstPoint;
mySecondPoint = aSecondPoint;
myCenterPoint = aCenterPoint;
DataPtr aData = myConstraint->data();
- AttributeDoublePtr anAttributeValue = aData->real(SketchPlugin_ConstraintAngle::ANGLE_VALUE_ID());
+ AttributeDoublePtr anAttributeValue =
+ aData->real(SketchPlugin_ConstraintAngle::ANGLE_VALUE_ID());
myValue.init(anAttributeValue);
std::shared_ptr<GeomDataAPI_Point2D> aFlyoutAttr =
std::dynamic_pointer_cast<GeomDataAPI_Point2D>
(aData->attribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT()));
- std::shared_ptr<GeomAPI_Pnt> aFlyoutPnt = mySketcherPlane->to3D(aFlyoutAttr->x(), aFlyoutAttr->y());
+ std::shared_ptr<GeomAPI_Pnt> aFlyoutPnt =
+ mySketcherPlane->to3D(aFlyoutAttr->x(), aFlyoutAttr->y());
myFlyOutPoint = aFlyoutPnt->impl<gp_Pnt>();
}
double SketcherPrs_Angle::calculateDistanceToFlyoutPoint()
{
- //gp_Dir aBisector = gp_Dir((myFirstPoint.XYZ() + mySecondPoint.XYZ()) * 0.5 - myCenterPoint.XYZ());
- //gp_XYZ aFlyDir = myFlyOutPoint.XYZ() - myCenterPoint.XYZ();
-
- //double aDistance = aFlyDir.Dot(aBisector.XYZ());
- //// make a positive distance in order to AIS angle presentation is not reversed
- //aDistance = fabs(aDistance);
- //return aDistance;
return myFlyOutPoint.Distance(myCenterPoint);
}
DEFINE_STANDARD_RTTI(SketcherPrs_Angle)
- /// Returns true if the constraint feature arguments are correcly filled to build AIS presentation
+ /// Returns true if the constraint feature arguments are correcly filled
+ /// to build AIS presentation
/// \param theConstraint a constraint feature
/// \param thePlane a coordinate plane of current sketch
/// \return boolean result value
const std::shared_ptr<GeomAPI_Ax3>& thePlane);
protected:
/// Redefinition of virtual function
- Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
+ Standard_EXPORT virtual void Compute(
+ const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
const Handle(Prs3d_Presentation)& thePresentation, const Standard_Integer theMode = 0);
/// Redefinition of virtual function
}
-void SketcherPrs_Coincident::Compute(const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
- const Handle(Prs3d_Presentation)& thePresentation,
- const Standard_Integer theMode)
+void SketcherPrs_Coincident::Compute(
+ const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
+ const Handle(Prs3d_Presentation)& thePresentation,
+ const Standard_Integer theMode)
{
gp_Pnt aPoint;
bool aReadyToDisplay = readyToDisplay(myConstraint, mySketcherPlane, aPoint);
Standard_EXPORT virtual void SetColor(const Quantity_NameOfColor aColor);
/// Set state of the presentation, in case of conflicting state, the icon of the presentation is
- /// visualized in error color. The state is stored in an internal field, so should be changed when
+ /// visualized in error color.
+ /// The state is stored in an internal field, so should be changed when
/// constraint become not conflicting
/// \param theConflicting a state
/// \param theColor a color for conflicting object
- Standard_EXPORT void SetConflictingConstraint(const bool& theConflicting, const std::vector<int>& theColor);
+ Standard_EXPORT void SetConflictingConstraint(const bool& theConflicting,
+ const std::vector<int>& theColor);
/// Returns true if the constraint feature arguments are correcly filled to build AIS presentation
/// \param theConstraint a constraint feature
DEFINE_STANDARD_RTTI(SketcherPrs_Coincident)
protected:
/// Redefinition of virtual function
- Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
+ Standard_EXPORT virtual void Compute(
+ const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
const Handle(Prs3d_Presentation)& thePresentation, const Standard_Integer theMode = 0);
/// Redefinition of virtual function
{
bool aReadyToDisplay = false;
- ObjectPtr aObj1 = SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_A());
- ObjectPtr aObj2 = SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_B());
+ ObjectPtr aObj1 =
+ SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_A());
+ ObjectPtr aObj2 =
+ SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_B());
aReadyToDisplay = SketcherPrs_Tools::getShape(aObj1).get() != NULL &&
SketcherPrs_Tools::getShape(aObj2).get() != NULL;
if (!IsReadyToDisplay(myConstraint, myPlane))
return false;
- ObjectPtr aObj1 = SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_A());
- ObjectPtr aObj2 = SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_B());
+ ObjectPtr aObj1 =
+ SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_A());
+ ObjectPtr aObj2 =
+ SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_B());
// Set points of the presentation
SketcherPrs_PositionMgr* aMgr = SketcherPrs_PositionMgr::get();
return true;
}
-void SketcherPrs_Collinear::drawLines(const Handle(Prs3d_Presentation)& thePrs, Quantity_Color theColor) const
+void SketcherPrs_Collinear::drawLines(const Handle(Prs3d_Presentation)& thePrs,
+ Quantity_Color theColor) const
{
Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup(thePrs);
- Handle(Graphic3d_AspectLine3d) aLineAspect = new Graphic3d_AspectLine3d(theColor, Aspect_TOL_SOLID, 2);
+ Handle(Graphic3d_AspectLine3d) aLineAspect =
+ new Graphic3d_AspectLine3d(theColor, Aspect_TOL_SOLID, 2);
aGroup->SetPrimitivesAspect(aLineAspect);
// Draw constrained lines
aLoop->removeListener(this);
}
-void SketcherPrs_DimensionStyleListener::processEvent(const std::shared_ptr<Events_Message>& theMessage)
+void SketcherPrs_DimensionStyleListener::processEvent(
+ const std::shared_ptr<Events_Message>& theMessage)
{
const Events_ID kParameterStyleEvent = SketcherPrs_ParameterStyleMessage::eventId();
if (theMessage->eventID() == kParameterStyleEvent) {
aCustomValue = theTextValue.c_str();
else {
// format value string using "sprintf"
- TCollection_AsciiString aFormatStr = theDimension->Attributes()->DimensionAspect()->ValueStringFormat();
+ TCollection_AsciiString aFormatStr =
+ theDimension->Attributes()->DimensionAspect()->ValueStringFormat();
char aFmtBuffer[256];
sprintf (aFmtBuffer, aFormatStr.ToCString(), theDoubleValue);
aCustomValue = TCollection_ExtendedString (aFmtBuffer);
}
else {
// format value string using "sprintf"
- TCollection_AsciiString aFormatStr = theDimension->Attributes()->DimensionAspect()->ValueStringFormat();
+ TCollection_AsciiString aFormatStr =
+ theDimension->Attributes()->DimensionAspect()->ValueStringFormat();
char aFmtBuffer[256];
sprintf (aFmtBuffer, aFormatStr.ToCString(), theDoubleValue);
aCustomValue = TCollection_ExtendedString (aFmtBuffer);
{
bool aReadyToDisplay = false;
- ObjectPtr aObj1 = SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_A());
- ObjectPtr aObj2 = SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_B());
+ ObjectPtr aObj1 =
+ SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_A());
+ ObjectPtr aObj2 =
+ SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_B());
aReadyToDisplay = SketcherPrs_Tools::getShape(aObj1).get() != NULL &&
SketcherPrs_Tools::getShape(aObj2).get() != NULL;
if (!IsReadyToDisplay(myConstraint, myPlane))
return false;
- ObjectPtr aObj1 = SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_A());
- ObjectPtr aObj2 = SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_B());
+ ObjectPtr aObj1 =
+ SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_A());
+ ObjectPtr aObj2 =
+ SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_B());
// Set points of the presentation
SketcherPrs_PositionMgr* aMgr = SketcherPrs_PositionMgr::get();
return true;
}
-void SketcherPrs_Equal::drawLines(const Handle(Prs3d_Presentation)& thePrs, Quantity_Color theColor) const
+void SketcherPrs_Equal::drawLines(const Handle(Prs3d_Presentation)& thePrs,
+ Quantity_Color theColor) const
{
Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup(thePrs);
- Handle(Graphic3d_AspectLine3d) aLineAspect = new Graphic3d_AspectLine3d(theColor, Aspect_TOL_SOLID, 2);
+ Handle(Graphic3d_AspectLine3d) aLineAspect =
+ new Graphic3d_AspectLine3d(theColor, Aspect_TOL_SOLID, 2);
aGroup->SetPrimitivesAspect(aLineAspect);
// Draw first line
anAISObj = thePrevious;
else {
anAISObj = AISObjectPtr(new GeomAPI_AISObject());
- Handle(SketcherPrs_HVDirection) aPrs = new SketcherPrs_HVDirection(theConstraint, thePlane, true);
+ Handle(SketcherPrs_HVDirection) aPrs =
+ new SketcherPrs_HVDirection(theConstraint, thePlane, true);
anAISObj->setImpl(new Handle(AIS_InteractiveObject)(aPrs));
}
}
anAISObj = thePrevious;
else {
anAISObj = AISObjectPtr(new GeomAPI_AISObject());
- Handle(SketcherPrs_HVDirection) aPrs = new SketcherPrs_HVDirection(theConstraint, thePlane, false);
+ Handle(SketcherPrs_HVDirection) aPrs =
+ new SketcherPrs_HVDirection(theConstraint, thePlane, false);
anAISObj->setImpl(new Handle(AIS_InteractiveObject)(aPrs));
}
}
anAISObj = thePrevious;
else {
anAISObj = AISObjectPtr(new GeomAPI_AISObject());
- Handle(SketcherPrs_Transformation) aPrs = new SketcherPrs_Transformation(theConstraint, thePlane, true);
+ Handle(SketcherPrs_Transformation) aPrs =
+ new SketcherPrs_Transformation(theConstraint, thePlane, true);
anAISObj->setImpl(new Handle(AIS_InteractiveObject)(aPrs));
}
}
anAISObj = thePrevious;
else {
anAISObj = AISObjectPtr(new GeomAPI_AISObject());
- Handle(SketcherPrs_Transformation) aPrs = new SketcherPrs_Transformation(theConstraint, thePlane, false);
+ Handle(SketcherPrs_Transformation) aPrs =
+ new SketcherPrs_Transformation(theConstraint, thePlane, false);
anAISObj->setImpl(new Handle(AIS_InteractiveObject)(aPrs));
}
}
const std::shared_ptr<GeomAPI_Ax3>&/* thePlane*/)
{
bool aReadyToDisplay = false;
- ObjectPtr aObj = SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_A());
+ ObjectPtr aObj =
+ SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_A());
aReadyToDisplay = SketcherPrs_Tools::getShape(aObj).get() != NULL;
return aReadyToDisplay;
return true;
}
-void SketcherPrs_HVDirection::drawLines(const Handle(Prs3d_Presentation)& thePrs, Quantity_Color theColor) const
+void SketcherPrs_HVDirection::drawLines(const Handle(Prs3d_Presentation)& thePrs,
+ Quantity_Color theColor) const
{
Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup(thePrs);
// Draw constrained object
- Handle(Graphic3d_AspectLine3d) aLineAspect = new Graphic3d_AspectLine3d(theColor, Aspect_TOL_SOLID, 2);
+ Handle(Graphic3d_AspectLine3d) aLineAspect =
+ new Graphic3d_AspectLine3d(theColor, Aspect_TOL_SOLID, 2);
aGroup->SetPrimitivesAspect(aLineAspect);
addLine(aGroup, SketchPlugin_Constraint::ENTITY_A());
IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_LengthDimension, AIS_LengthDimension);
SketcherPrs_LengthDimension::SketcherPrs_LengthDimension(ModelAPI_Feature* theConstraint,
- const std::shared_ptr<GeomAPI_Ax3>& thePlane)
+ const std::shared_ptr<GeomAPI_Ax3>& thePlane)
: AIS_LengthDimension(MyDefStart, MyDefEnd, MyDefPln),
myConstraint(theConstraint),
mySketcherPlane(thePlane),
return readyToDisplay(theConstraint, thePlane, aPnt1, aPnt2);
}
-void SketcherPrs_LengthDimension::Compute(const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
- const Handle(Prs3d_Presentation)& thePresentation,
- const Standard_Integer theMode)
+void SketcherPrs_LengthDimension::Compute(
+ const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
+ const Handle(Prs3d_Presentation)& thePresentation,
+ const Standard_Integer theMode)
{
gp_Pnt aPnt1, aPnt2;
bool aReadyToDisplay = readyToDisplay(myConstraint, mySketcherPlane, aPnt1, aPnt2);
DEFINE_STANDARD_RTTI(SketcherPrs_LengthDimension)
- /// Returns true if the constraint feature arguments are correcly filled to build AIS presentation
+ /// Returns true if the constraint feature arguments are correcly filled
+ /// to build AIS presentation
/// \param theConstraint a constraint feature
/// \param thePlane a coordinate plane of current sketch
/// \return boolean result value
const std::shared_ptr<GeomAPI_Ax3>& thePlane);
protected:
/// Redefinition of virtual function
- Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
- const Handle(Prs3d_Presentation)& thePresentation, const Standard_Integer theMode = 0);
+ Standard_EXPORT virtual void Compute(
+ const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
+ const Handle(Prs3d_Presentation)& thePresentation,
+ const Standard_Integer theMode = 0);
/// Redefinition of virtual function
Standard_EXPORT virtual void ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
/// Listener to update dimension visualization style
SketcherPrs_DimensionStyleListener* myStyleListener;
- /// container of values obtained from the constraint, which are necessary to fill the presentation
+ /// container of values obtained from the constraint, which are necessary
+ /// to fill the presentation
gp_Pnt myFirstPoint; ///< the dimension first point for measured geometry
gp_Pnt mySecondPoint; ///< the dimension first point for measured geometry
gp_Pln myPlane; ///< the plane(plane of the sketch) for measured geometry
double myDistance; ///< the flyout distance
- SketcherPrs_DimensionStyleListener::DimensionValue myValue; /// the structure filled by constraint
+ /// the structure filled by constraint
+ SketcherPrs_DimensionStyleListener::DimensionValue myValue;
};
#endif
\ No newline at end of file
{
bool aReadyToDisplay = false;
- ObjectPtr aObj1 = SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_A());
- ObjectPtr aObj2 = SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_B());
+ ObjectPtr aObj1 =
+ SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_A());
+ ObjectPtr aObj2 =
+ SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_B());
// one object is a feature Line, other object is a point result. We check shape of point result
aReadyToDisplay = aObj1.get() && aObj2.get() &&
ObjectPtr aPointObject;
// find a line result to set middle symbol near it
- AttributePtr anAttribute = SketcherPrs_Tools::getAttribute(myConstraint, SketchPlugin_Constraint::ENTITY_A());
+ AttributePtr anAttribute =
+ SketcherPrs_Tools::getAttribute(myConstraint, SketchPlugin_Constraint::ENTITY_A());
if (!anAttribute.get()) {
- ObjectPtr aObj = SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_A());
+ ObjectPtr aObj =
+ SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_A());
std::shared_ptr<GeomAPI_Shape> aShape = SketcherPrs_Tools::getShape(aObj);
if (aShape.get() && aShape->isEdge())
aPointObject = aObj;
}
if (!aPointObject.get()) {
- ObjectPtr aObj = SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_B());
+ ObjectPtr aObj =
+ SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_B());
std::shared_ptr<GeomAPI_Shape> aShape = SketcherPrs_Tools::getShape(aObj);
if (aShape.get() && aShape->isEdge())
aPointObject = aObj;
return true;
}
-void SketcherPrs_Middle::drawLines(const Handle(Prs3d_Presentation)& thePrs, Quantity_Color theColor) const
+void SketcherPrs_Middle::drawLines(const Handle(Prs3d_Presentation)& thePrs,
+ Quantity_Color theColor) const
{
Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup(thePrs);
- Handle(Graphic3d_AspectLine3d) aLineAspect = new Graphic3d_AspectLine3d(theColor, Aspect_TOL_SOLID, 2);
+ Handle(Graphic3d_AspectLine3d) aLineAspect =
+ new Graphic3d_AspectLine3d(theColor, Aspect_TOL_SOLID, 2);
aGroup->SetPrimitivesAspect(aLineAspect);
// Draw objects
- ObjectPtr aObject = SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_A());
+ ObjectPtr aObject =
+ SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_A());
drawLine(thePrs, theColor, aObject);
aObject = SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_A());
bool aReadyToDisplay = false;
// Get axis of mirror
- ObjectPtr aAxisObj = SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_A());
+ ObjectPtr aAxisObj =
+ SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_A());
if (SketcherPrs_Tools::getShape(aAxisObj).get() == NULL)
return aReadyToDisplay;
std::shared_ptr<ModelAPI_Data> aData = theConstraint->data();
// Get source objects
- std::shared_ptr<ModelAPI_AttributeRefList> anAttrB = aData->reflist(SketchPlugin_Constraint::ENTITY_B());
+ std::shared_ptr<ModelAPI_AttributeRefList> anAttrB =
+ aData->reflist(SketchPlugin_Constraint::ENTITY_B());
if (anAttrB.get() == NULL)
return aReadyToDisplay;
// Get mirrored objects
- std::shared_ptr<ModelAPI_AttributeRefList> anAttrC = aData->reflist(SketchPlugin_Constraint::ENTITY_C());
+ std::shared_ptr<ModelAPI_AttributeRefList> anAttrC =
+ aData->reflist(SketchPlugin_Constraint::ENTITY_C());
if (anAttrC.get() == NULL)
return aReadyToDisplay;
return false;
// Get axis of mirror
- ObjectPtr aAxisObj = SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_A());
+ ObjectPtr aAxisObj =
+ SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_A());
std::shared_ptr<ModelAPI_Data> aData = myConstraint->data();
// Get source objects
- std::shared_ptr<ModelAPI_AttributeRefList> anAttrB = aData->reflist(SketchPlugin_Constraint::ENTITY_B());
+ std::shared_ptr<ModelAPI_AttributeRefList> anAttrB =
+ aData->reflist(SketchPlugin_Constraint::ENTITY_B());
// Get mirrored objects
- std::shared_ptr<ModelAPI_AttributeRefList> anAttrC = aData->reflist(SketchPlugin_Constraint::ENTITY_C());
+ std::shared_ptr<ModelAPI_AttributeRefList> anAttrC =
+ aData->reflist(SketchPlugin_Constraint::ENTITY_C());
SketcherPrs_PositionMgr* aMgr = SketcherPrs_PositionMgr::get();
int aNb = anAttrB->size();
}
-void SketcherPrs_Mirror::drawLines(const Handle(Prs3d_Presentation)& thePrs, Quantity_Color theColor) const
+void SketcherPrs_Mirror::drawLines(const Handle(Prs3d_Presentation)& thePrs,
+ Quantity_Color theColor) const
{
std::shared_ptr<ModelAPI_Data> aData = myConstraint->data();
- std::shared_ptr<ModelAPI_AttributeRefList> anAttrB = aData->reflist(SketchPlugin_Constraint::ENTITY_B());
+ std::shared_ptr<ModelAPI_AttributeRefList> anAttrB =
+ aData->reflist(SketchPlugin_Constraint::ENTITY_B());
if (anAttrB.get() == NULL)
return;
- std::shared_ptr<ModelAPI_AttributeRefList> anAttrC = aData->reflist(SketchPlugin_Constraint::ENTITY_C());
+ std::shared_ptr<ModelAPI_AttributeRefList> anAttrC =
+ aData->reflist(SketchPlugin_Constraint::ENTITY_C());
if (anAttrC.get() == NULL)
return;
{
bool aReadyToDisplay = false;
- ObjectPtr aObj1 = SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_A());
- ObjectPtr aObj2 = SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_B());
+ ObjectPtr aObj1 =
+ SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_A());
+ ObjectPtr aObj2 =
+ SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_B());
aReadyToDisplay = SketcherPrs_Tools::getShape(aObj1).get() != NULL &&
SketcherPrs_Tools::getShape(aObj2).get() != NULL;
if (!IsReadyToDisplay(myConstraint, myPlane))
return false;
- ObjectPtr aObj1 = SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_A());
- ObjectPtr aObj2 = SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_B());
+ ObjectPtr aObj1 =
+ SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_A());
+ ObjectPtr aObj2 =
+ SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_B());
// Compute position of symbols
SketcherPrs_PositionMgr* aMgr = SketcherPrs_PositionMgr::get();
}
-void SketcherPrs_Parallel::drawLines(const Handle(Prs3d_Presentation)& thePrs, Quantity_Color theColor) const
+void SketcherPrs_Parallel::drawLines(const Handle(Prs3d_Presentation)& thePrs,
+ Quantity_Color theColor) const
{
Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup(thePrs);
- Handle(Graphic3d_AspectLine3d) aLineAspect = new Graphic3d_AspectLine3d(theColor, Aspect_TOL_SOLID, 2);
+ Handle(Graphic3d_AspectLine3d) aLineAspect =
+ new Graphic3d_AspectLine3d(theColor, Aspect_TOL_SOLID, 2);
aGroup->SetPrimitivesAspect(aLineAspect);
// Draw constrained lines
static Handle(Image_AlienPixMap) MyPixMap;
SketcherPrs_Perpendicular::SketcherPrs_Perpendicular(ModelAPI_Feature* theConstraint,
- const std::shared_ptr<GeomAPI_Ax3>& thePlane)
+ const std::shared_ptr<GeomAPI_Ax3>& thePlane)
: SketcherPrs_SymbolPrs(theConstraint, thePlane)
{
// Create default array
{
bool aReadyToDisplay = false;
- ObjectPtr aObj1 = SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_A());
- ObjectPtr aObj2 = SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_B());
+ ObjectPtr aObj1 =
+ SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_A());
+ ObjectPtr aObj2 =
+ SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_B());
aReadyToDisplay = SketcherPrs_Tools::getShape(aObj1).get() != NULL &&
SketcherPrs_Tools::getShape(aObj2).get() != NULL;
if (!IsReadyToDisplay(myConstraint, myPlane))
return false;
- ObjectPtr aObj1 = SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_A());
- ObjectPtr aObj2 = SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_B());
+ ObjectPtr aObj1 =
+ SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_A());
+ ObjectPtr aObj2 =
+ SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_B());
// Compute position of symbols
SketcherPrs_PositionMgr* aMgr = SketcherPrs_PositionMgr::get();
}
-void SketcherPrs_Perpendicular::drawLines(const Handle(Prs3d_Presentation)& thePrs, Quantity_Color theColor) const
+void SketcherPrs_Perpendicular::drawLines(const Handle(Prs3d_Presentation)& thePrs,
+ Quantity_Color theColor) const
{
Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup(thePrs);
- Handle(Graphic3d_AspectLine3d) aLineAspect = new Graphic3d_AspectLine3d(theColor, Aspect_TOL_SOLID, 2);
+ Handle(Graphic3d_AspectLine3d) aLineAspect =
+ new Graphic3d_AspectLine3d(theColor, Aspect_TOL_SOLID, 2);
aGroup->SetPrimitivesAspect(aLineAspect);
// Draw constrained lines
gp_Pnt aP; // Central point
gp_Vec aVec1; // main vector
if (aShape->isEdge()) {
- std::shared_ptr<GeomAPI_Curve> aCurve = std::shared_ptr<GeomAPI_Curve>(new GeomAPI_Curve(aShape));
+ std::shared_ptr<GeomAPI_Curve> aCurve =
+ std::shared_ptr<GeomAPI_Curve>(new GeomAPI_Curve(aShape));
std::shared_ptr<GeomAPI_Pnt> aPnt1; // Start point of main vector
std::shared_ptr<GeomAPI_Pnt> aPnt2; // End point of main vector
if (aCurve->isLine()) {
aVec1 = gp_Vec(aPnt1->impl<gp_Pnt>(), aPnt2->impl<gp_Pnt>());
} else {
// This is a point
- std::shared_ptr<GeomAPI_Vertex> aVertex = std::shared_ptr<GeomAPI_Vertex>(new GeomAPI_Vertex(aShape));
+ std::shared_ptr<GeomAPI_Vertex> aVertex =
+ std::shared_ptr<GeomAPI_Vertex>(new GeomAPI_Vertex(aShape));
std::shared_ptr<GeomAPI_Pnt> aPnt = aVertex->point();
aP = aPnt->impl<gp_Pnt>();
std::shared_ptr<GeomAPI_Dir> aNormal = thePlane->normal();
GeomAPI_Circ aCircle(aCenter, aNormal, aRadius);
- std::shared_ptr<GeomAPI_Pnt> anAnchor = SketcherPrs_Tools::getAnchorPoint(theConstraint, thePlane);
+ std::shared_ptr<GeomAPI_Pnt> anAnchor =
+ SketcherPrs_Tools::getAnchorPoint(theConstraint, thePlane);
theCircle = aCircle.impl<gp_Circ>();
theAnchorPoint = anAnchor->impl<gp_Pnt>();
return aReadyToDisplay;
}
-void SketcherPrs_Radius::Compute(const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
- const Handle(Prs3d_Presentation)& thePresentation,
- const Standard_Integer theMode)
+void SketcherPrs_Radius::Compute(
+ const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
+ const Handle(Prs3d_Presentation)& thePresentation,
+ const Standard_Integer theMode)
{
gp_Circ aCircle;
gp_Pnt anAnchorPoint;
DEFINE_STANDARD_RTTI(SketcherPrs_Radius)
- /// Returns true if the constraint feature arguments are correcly filled to build AIS presentation
+ /// Returns true if the constraint feature arguments are correcly filled
+ /// to build AIS presentation
/// \param theConstraint a constraint feature
/// \param thePlane a coordinate plane of current sketch
/// \return boolean result value
gp_Circ& theCircle, gp_Pnt& theAnchorPoint);
protected:
/// Redefinition of virtual function
- Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
+ Standard_EXPORT virtual void Compute(
+ const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
const Handle(Prs3d_Presentation)& thePresentation, const Standard_Integer theMode = 0);
/// Redefinition of virtual function
bool aReadyToDisplay = false;
std::shared_ptr<ModelAPI_Data> aData = theConstraint->data();
- std::shared_ptr<ModelAPI_AttributeRefAttr> anAttr = aData->refattr(SketchPlugin_Constraint::ENTITY_A());
+ std::shared_ptr<ModelAPI_AttributeRefAttr> anAttr =
+ aData->refattr(SketchPlugin_Constraint::ENTITY_A());
AttributePtr aRefAttr = anAttr->attr();
if (anAttr->isObject()) {
// The constraint attached to an object
} else {
// The constraint attached to a point
std::shared_ptr<GeomAPI_Pnt2d> aPnt = SketcherPrs_Tools::getPoint(theConstraint,
- SketchPlugin_Constraint::ENTITY_A());
+ SketchPlugin_Constraint::ENTITY_A());
aReadyToDisplay = aPnt.get() != NULL;
}
return aReadyToDisplay;
return false;
std::shared_ptr<ModelAPI_Data> aData = myConstraint->data();
- std::shared_ptr<ModelAPI_AttributeRefAttr> anAttr = aData->refattr(SketchPlugin_Constraint::ENTITY_A());
+ std::shared_ptr<ModelAPI_AttributeRefAttr> anAttr =
+ aData->refattr(SketchPlugin_Constraint::ENTITY_A());
AttributePtr aRefAttr = anAttr->attr();
if (anAttr->isObject()) {
// The constraint attached to an object
}
-void SketcherPrs_Rigid::drawLines(const Handle(Prs3d_Presentation)& thePrs, Quantity_Color theColor) const
+void SketcherPrs_Rigid::drawLines(const Handle(Prs3d_Presentation)& thePrs,
+ Quantity_Color theColor) const
{
ObjectPtr aObj = SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_A());
FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aObj);
return;
Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup(thePrs);
- Handle(Graphic3d_AspectLine3d) aLineAspect = new Graphic3d_AspectLine3d(theColor, Aspect_TOL_SOLID, 2);
+ Handle(Graphic3d_AspectLine3d) aLineAspect =
+ new Graphic3d_AspectLine3d(theColor, Aspect_TOL_SOLID, 2);
aGroup->SetPrimitivesAspect(aLineAspect);
Handle(Prs3d_PointAspect) aPntAspect = new Prs3d_PointAspect(Aspect_TOM_PLUS, theColor, 1);
IMPLEMENT_STANDARD_HANDLE(SketcherPrs_SensitivePoint, Select3D_SensitiveEntity);
IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_SensitivePoint, Select3D_SensitiveEntity);
-SketcherPrs_SensitivePoint::SketcherPrs_SensitivePoint(const Handle(SelectBasics_EntityOwner)& anOwner,
- int theId)
+SketcherPrs_SensitivePoint::SketcherPrs_SensitivePoint(
+ const Handle(SelectBasics_EntityOwner)& anOwner, int theId)
:Select3D_SensitiveEntity(anOwner), myId(theId)
{
SetSensitivityFactor(12);
}
-Standard_Boolean SketcherPrs_SensitivePoint::Matches (SelectBasics_SelectingVolumeManager& theMgr,
+Standard_Boolean SketcherPrs_SensitivePoint::Matches(SelectBasics_SelectingVolumeManager& theMgr,
SelectBasics_PickResult& thePickResult)
{
Standard_Real aDepth = RealLast();
//! Constructs a sensitive point object defined by the
//! \param OwnerId an Id of the Owner.
//! \param theId and Id of its point
- Standard_EXPORT SketcherPrs_SensitivePoint(const Handle(SelectBasics_EntityOwner)& OwnerId, int theId);
+ Standard_EXPORT SketcherPrs_SensitivePoint(const Handle(SelectBasics_EntityOwner)& OwnerId,
+ int theId);
/// Returns number of sub-elements
Standard_EXPORT virtual Standard_Integer NbSubElements() Standard_OVERRIDE;
//! Checks whether the point overlaps current selecting volume
//! \param theMgr selection manager
//! \param thePickResult returns pick result
- Standard_EXPORT virtual Standard_Boolean Matches (SelectBasics_SelectingVolumeManager& theMgr,
- SelectBasics_PickResult& thePickResult) Standard_OVERRIDE;
+ Standard_EXPORT virtual Standard_Boolean Matches(SelectBasics_SelectingVolumeManager& theMgr,
+ SelectBasics_PickResult& thePickResult) Standard_OVERRIDE;
//! Returns the point used at the time of construction.
Standard_EXPORT gp_Pnt Point() const;
if (aDataType == GL_NONE) {
continue;
} else if (anAttrib.Id == Graphic3d_TOA_POS) {
- OpenGl_VertexBuffer::bindAttribute (theGlCtx, Graphic3d_TOA_POS, aNbComp, aDataType, Stride, anOffset);
+ OpenGl_VertexBuffer::bindAttribute(theGlCtx, Graphic3d_TOA_POS, aNbComp,
+ aDataType, Stride, anOffset);
break;
}
if (aDataType == GL_NONE)
continue;
- OpenGl_VertexBuffer::bindAttribute (theGlCtx, anAttrib.Id, aNbComp, aDataType, Stride, anOffset);
+ OpenGl_VertexBuffer::bindAttribute(theGlCtx, anAttrib.Id, aNbComp,
+ aDataType, Stride, anOffset);
anOffset += Graphic3d_Attribute::Stride (anAttrib.DataType);
}
}
{
Handle(SketcherPrs_SymbolPrs) anIObj = (SketcherPrs_SymbolPrs*)theUserDraw->Data;
if (anIObj.IsNull()) {
- std::cout << "VUserDrawCallback error: null object passed, the custom scene element will not be rendered" << std::endl;
+ std::cout <<
+ "VUserDrawCallback error: null object passed, the custom scene element will not be rendered"
+ << std::endl;
}
return new SketcherPrs_Element(anIObj);
}
}
}
-void SketcherPrs_SymbolPrs::addLine(const Handle(Graphic3d_Group)& theGroup, std::string theAttrName) const
+void SketcherPrs_SymbolPrs::addLine(const Handle(Graphic3d_Group)& theGroup,
+ std::string theAttrName) const
{
ObjectPtr aObj = SketcherPrs_Tools::getResult(myConstraint, theAttrName);
std::shared_ptr<GeomAPI_Shape> aLine = SketcherPrs_Tools::getShape(aObj);
theGroup->AddPrimitiveArray(aLines);
}
-void SketcherPrs_SymbolPrs::HilightSelected(const Handle(PrsMgr_PresentationManager3d)& thePM,
+void SketcherPrs_SymbolPrs::HilightSelected(const Handle(PrsMgr_PresentationManager3d)& thePM,
const SelectMgr_SequenceOfOwner& theOwners)
{
thePM->Highlight(this);
}
-void SketcherPrs_SymbolPrs::HilightOwnerWithColor(const Handle(PrsMgr_PresentationManager3d)& thePM,
- const Quantity_NameOfColor theColor,
- const Handle(SelectMgr_EntityOwner)& theOwner)
+void SketcherPrs_SymbolPrs::HilightOwnerWithColor(
+ const Handle(PrsMgr_PresentationManager3d)& thePM,
+ const Quantity_NameOfColor theColor,
+ const Handle(SelectMgr_EntityOwner)& theOwner)
{
thePM->Color(this, theColor);
thePM->AddToImmediateList(aHilightPrs);
}
-void SketcherPrs_SymbolPrs::Compute(const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
- const Handle(Prs3d_Presentation)& thePresentation,
- const Standard_Integer theMode)
+void SketcherPrs_SymbolPrs::Compute(
+ const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
+ const Handle(Prs3d_Presentation)& thePresentation,
+ const Standard_Integer theMode)
{
// Create an icon
prepareAspect();
Handle(AIS_InteractiveContext) aCtx = GetContext();
- Handle(OpenGl_GraphicDriver) aDriver = Handle(OpenGl_GraphicDriver)::DownCast(aCtx->CurrentViewer()->Driver());
+ Handle(OpenGl_GraphicDriver) aDriver =
+ Handle(OpenGl_GraphicDriver)::DownCast(aCtx->CurrentViewer()->Driver());
if (!aDriver.IsNull()) {
// register the custom element factory function
aDriver->UserDrawCallback() = SymbolPrsCallBack;
if (theConflicting)
{
if (!myAspect.IsNull())
- myAspect->SetColor (Quantity_Color (theColor[0] / 255., theColor[1] / 255., theColor[2] / 255.,
- Quantity_TOC_RGB));
+ myAspect->SetColor (Quantity_Color (theColor[0] / 255., theColor[1] / 255.,
+ theColor[2] / 255., Quantity_TOC_RGB));
myIsConflicting = true;
}
else
// this method is a combination of OCCT OpenGL functions. The main purpose is to have
// equal distance from the source object to symbol indpendently of zoom.
// It is base on OCCT 6.9.1 and might need changes when using later OCCT versions.
- // The specific SHAPER modifications are marked by ShaperModification:start/end, other is OCCT code
+ // The specific SHAPER modifications are marked by ShaperModification:start/end,
+ // other is OCCT code
// do not update presentation for invalid or already removed objects: the presentation
// should be removed soon
}
// Update drawing attributes
- if (!myVboAttribs->init(aCtx, 0, aAttribs->NbElements, aAttribs->Data(), GL_NONE, aAttribs->Stride)) {
+ if (!myVboAttribs->init(aCtx, 0, aAttribs->NbElements,
+ aAttribs->Data(), GL_NONE, aAttribs->Stride)) {
myVboAttribs->Release (aCtx.operator->());
myVboAttribs.Nullify();
return;
if (!aSpriteNorm.IsNull() && !aSpriteNorm->IsDisplayList()) {
// ShaperModification:start : filling the presentation with color if there is a conflict
- const bool toHilight = (theWorkspace->NamedStatus & OPENGL_NS_HIGHLIGHT) != 0 || myIsConflicting;
+ const bool toHilight =
+ (theWorkspace->NamedStatus & OPENGL_NS_HIGHLIGHT) != 0 || myIsConflicting;
// ShaperModification:end
- const Handle(OpenGl_PointSprite)& aSprite = (toHilight && anAspectMarker->SpriteHighlightRes(aCtx)->IsValid())
- ? anAspectMarker->SpriteHighlightRes(aCtx)
+ const Handle(OpenGl_PointSprite)& aSprite =
+ (toHilight && anAspectMarker->SpriteHighlightRes(aCtx)->IsValid())?
+ anAspectMarker->SpriteHighlightRes(aCtx)
: aSpriteNorm;
theWorkspace->EnableTexture (aSprite);
- aCtx->ShaderManager()->BindProgram(anAspectMarker, aSprite, Standard_False, Standard_False, anAspectMarker->ShaderProgramRes(aCtx));
+ aCtx->ShaderManager()->BindProgram(anAspectMarker, aSprite, Standard_False,
+ Standard_False, anAspectMarker->ShaderProgramRes(aCtx));
const TEL_COLOUR* aLineColor = &anAspectMarker->Color();
if (theWorkspace->NamedStatus & OPENGL_NS_HIGHLIGHT)
aLineColor = theWorkspace->HighlightColor;
std::shared_ptr<GeomAPI_Curve>(new GeomAPI_Curve(theShape));
if (aCurve->isLine()) {
// The shape is line
- GeomAdaptor_Curve aCurv(aCurve->impl<Handle(Geom_Curve)>(), aCurve->startParam(), aCurve->endParam());
+ GeomAdaptor_Curve
+ aCurv(aCurve->impl<Handle(Geom_Curve)>(), aCurve->startParam(), aCurve->endParam());
StdPrs_Curve::Add(thePrs, aCurv, myDrawer);
} else {
// The shape is circle or arc
- GeomAdaptor_Curve aAdaptor(aCurve->impl<Handle(Geom_Curve)>(), aCurve->startParam(), aCurve->endParam());
+ GeomAdaptor_Curve
+ aAdaptor(aCurve->impl<Handle(Geom_Curve)>(), aCurve->startParam(), aCurve->endParam());
StdPrs_DeflectionCurve::Add(thePrs,aAdaptor,myDrawer);
}
} else if (theShape->isVertex()) {
}
}
-void SketcherPrs_SymbolPrs::drawListOfShapes(const std::shared_ptr<ModelAPI_AttributeRefList>& theListAttr,
- const Handle(Prs3d_Presentation)& thePrs) const
+void SketcherPrs_SymbolPrs::drawListOfShapes(
+ const std::shared_ptr<ModelAPI_AttributeRefList>& theListAttr,
+ const Handle(Prs3d_Presentation)& thePrs) const
{
int aNb = theListAttr->size();
if (aNb == 0)
virtual ~SketcherPrs_SymbolPrs();
//! Method which draws selected owners ( for fast presentation draw )
- Standard_EXPORT virtual void HilightSelected(const Handle(PrsMgr_PresentationManager3d)& thePM,
+ Standard_EXPORT virtual void HilightSelected(const Handle(PrsMgr_PresentationManager3d)& thePM,
const SelectMgr_SequenceOfOwner& theOwners);
//! Method which hilight an owner belonging to
//! this selectable object ( for fast presentation draw )
- Standard_EXPORT virtual void HilightOwnerWithColor(const Handle(PrsMgr_PresentationManager3d)& thePM,
- const Quantity_NameOfColor theColor, const Handle(SelectMgr_EntityOwner)& theOwner);
+ Standard_EXPORT virtual void HilightOwnerWithColor(
+ const Handle(PrsMgr_PresentationManager3d)& thePM,
+ const Quantity_NameOfColor theColor,
+ const Handle(SelectMgr_EntityOwner)& theOwner);
/// Returns sketcher plane
Standard_EXPORT std::shared_ptr<GeomAPI_Ax3> plane() const { return myPlane; }
const Handle(Graphic3d_ArrayOfPoints)& pointsArray() const { return myPntArray; }
/// Set state of the presentation, in case of conflicting state, the icon of the presentation is
- /// visualized in error color. The state is stored in an internal field, so should be changed when
- /// constraint become not conflicting
+ /// visualized in error color. The state is stored in an internal field, so should be changed
+ /// when constraint become not conflicting
/// \param theConflicting a state
/// \param theColor a color for conflicting object
- Standard_EXPORT void SetConflictingConstraint(const bool& theConflicting, const std::vector<int>& theColor);
+ Standard_EXPORT void SetConflictingConstraint(const bool& theConflicting,
+ const std::vector<int>& theColor);
/// Render of the presentation
/// \param theWorkspace is OpenGl workspace
protected:
/// Redefinition of virtual function
- Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
+ Standard_EXPORT virtual void Compute(
+ const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
const Handle(Prs3d_Presentation)& thePresentation, const Standard_Integer theMode = 0);
/// Redefinition of virtual function
{
bool aReadyToDisplay = false;
- ObjectPtr aObj1 = SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_A());
- ObjectPtr aObj2 = SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_B());
+ ObjectPtr aObj1 =
+ SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_A());
+ ObjectPtr aObj2 =
+ SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_B());
aReadyToDisplay = SketcherPrs_Tools::getShape(aObj1).get() != NULL &&
SketcherPrs_Tools::getShape(aObj2).get() != NULL;
if (!IsReadyToDisplay(myConstraint, myPlane))
return false;
- ObjectPtr aObj1 = SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_A());
- ObjectPtr aObj2 = SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_B());
+ ObjectPtr aObj1 =
+ SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_A());
+ ObjectPtr aObj2 =
+ SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_B());
// Compute points coordinates
SketcherPrs_PositionMgr* aMgr = SketcherPrs_PositionMgr::get();
return true;
}
-void SketcherPrs_Tangent::drawLines(const Handle(Prs3d_Presentation)& thePrs, Quantity_Color theColor) const
+void SketcherPrs_Tangent::drawLines(const Handle(Prs3d_Presentation)& thePrs,
+ Quantity_Color theColor) const
{
Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup(thePrs);
- Handle(Graphic3d_AspectLine3d) aLineAspect = new Graphic3d_AspectLine3d(theColor, Aspect_TOL_SOLID, 2);
+ Handle(Graphic3d_AspectLine3d) aLineAspect =
+ new Graphic3d_AspectLine3d(theColor, Aspect_TOL_SOLID, 2);
aGroup->SetPrimitivesAspect(aLineAspect);
ObjectPtr aObj1 = SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_A());
std::shared_ptr<GeomAPI_Shape> getShape(ObjectPtr theObject)
{
ResultConstructionPtr aRes = std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(theObject);
- if (aRes.get() != NULL && aRes->data()->isValid()) {/// essential check as it is called in openGl thread
+ if (aRes.get() != NULL && aRes->data()->isValid()) {
+ /// essential check as it is called in openGl thread
return aRes->shape();
}
return std::shared_ptr<GeomAPI_Shape>();
{
std::shared_ptr<GeomDataAPI_Point2D> aFlyoutPoint =
std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
- const_cast<ModelAPI_Feature*>(theConstraint)->attribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT()));
+ const_cast<ModelAPI_Feature*>(
+ theConstraint)->attribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT()));
// for not initialized values return zero distance to avoid Presentation crash
if (!aFlyoutPoint->isInitialized())
return 0;
return anAspect;
}
-void updateArrows(Handle(Prs3d_DimensionAspect) theDimAspect, double theDimValue, double theTextSize)
+void updateArrows(Handle(Prs3d_DimensionAspect) theDimAspect,
+ double theDimValue, double theTextSize)
{
double anArrowLength = theDimAspect->ArrowAspect()->Length();
// This is not realy correct way to get viewer scale.
if(theTextSize > ((theDimValue - 3 * SketcherPrs_Tools::getArrowSize()) * aViewerScale)) {
theDimAspect->SetTextHorizontalPosition(Prs3d_DTHP_Left);
theDimAspect->SetArrowOrientation(Prs3d_DAO_External);
- theDimAspect->SetExtensionSize((theTextSize / aViewerScale + SketcherPrs_Tools::getArrowSize()) / 2.0);
+ theDimAspect->SetExtensionSize(
+ (theTextSize / aViewerScale + SketcherPrs_Tools::getArrowSize()) / 2.0);
} else {
theDimAspect->SetTextHorizontalPosition(Prs3d_DTHP_Center);
theDimAspect->SetArrowOrientation(Prs3d_DAO_Internal);
void sendEmptyPresentationError(ModelAPI_Feature* theFeature, const std::string theError)
{
- Events_InfoMessage("SketcherPrs_Tools", "An empty AIS presentation: SketcherPrs_LengthDimension").send();
+ Events_InfoMessage("SketcherPrs_Tools",
+ "An empty AIS presentation: SketcherPrs_LengthDimension").send();
static const Events_ID anEvent = Events_Loop::eventByName(EVENT_EMPTY_AIS_PRESENTATION);
std::shared_ptr<ModelAPI_Object> aConstraintPtr(theFeature);
ModelAPI_EventCreator::get()->sendUpdated(aConstraintPtr, anEvent);
//#define MyTextHeight 20
-/// Message that style of visualization of parameter is changed. It will be shown as expression or value
+/// Message that style of visualization of parameter is changed.
+/// It will be shown as expression or value
class SketcherPrs_ParameterStyleMessage : public Events_Message
{
public:
/// \param theAttribute an attribute name
/// \param thePlane a projection plane (sketcher plane)
SKETCHERPRS_EXPORT std::shared_ptr<GeomDataAPI_Point2D> getFeaturePoint(DataPtr theData,
- const std::string& theAttribute,
- const std::shared_ptr<GeomAPI_Ax3>& thePlane);
+ const std::string& theAttribute,
+ const std::shared_ptr<GeomAPI_Ax3>& thePlane);
/// Returns value of dimension arrows size
SKETCHERPRS_EXPORT double getArrowSize();
std::shared_ptr<ModelAPI_Data> aData = theConstraint->data();
// Get transformated objects list
- std::shared_ptr<ModelAPI_AttributeRefList> anAttrB = aData->reflist(SketchPlugin_Constraint::ENTITY_B());
+ std::shared_ptr<ModelAPI_AttributeRefList> anAttrB =
+ aData->reflist(SketchPlugin_Constraint::ENTITY_B());
if (anAttrB.get() == NULL)
return aReadyToDisplay;
AttributePoint2DPtr aEnd = GeomDataAPI_Point2D::getPoint2D(aData,
SketchPlugin_MultiTranslation::END_POINT_ID());
- aReadyToDisplay = aStart.get() && aEnd.get() && aStart->isInitialized() && aEnd->isInitialized();
+ aReadyToDisplay =
+ aStart.get() && aEnd.get() && aStart->isInitialized() && aEnd->isInitialized();
}
else if (theConstraint->getKind() == SketchPlugin_MultiRotation::ID()) {
// if it is rotation
- AttributePoint2DPtr aCenter = GeomDataAPI_Point2D::getPoint2D(aData, SketchPlugin_MultiRotation::CENTER_ID());
+ AttributePoint2DPtr aCenter =
+ GeomDataAPI_Point2D::getPoint2D(aData, SketchPlugin_MultiRotation::CENTER_ID());
aReadyToDisplay = aCenter.get() && aCenter->isInitialized();
}
#endif
std::shared_ptr<ModelAPI_Data> aData = myConstraint->data();
// Get transformated objects list
- std::shared_ptr<ModelAPI_AttributeRefList> anAttrB = aData->reflist(SketchPlugin_Constraint::ENTITY_B());
+ std::shared_ptr<ModelAPI_AttributeRefList> anAttrB =
+ aData->reflist(SketchPlugin_Constraint::ENTITY_B());
int aNbB = anAttrB->size();
if (aNbB == 0)
return true;
}
-void SketcherPrs_Transformation::drawLines(const Handle(Prs3d_Presentation)& thePrs, Quantity_Color theColor) const
+void SketcherPrs_Transformation::drawLines(const Handle(Prs3d_Presentation)& thePrs,
+ Quantity_Color theColor) const
{
std::shared_ptr<ModelAPI_Data> aData = myConstraint->data();
- std::shared_ptr<ModelAPI_AttributeRefList> anAttrB = aData->reflist(SketchPlugin_Constraint::ENTITY_B());
+ std::shared_ptr<ModelAPI_AttributeRefList> anAttrB =
+ aData->reflist(SketchPlugin_Constraint::ENTITY_B());
if (anAttrB.get() == NULL)
return;
Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup(thePrs);
- //Handle(Graphic3d_AspectLine3d) aLineAspect = new Graphic3d_AspectLine3d(theColor, Aspect_TOL_SOLID, 2);
- //aGroup->SetPrimitivesAspect(aLineAspect);
-
// drawListOfShapes uses myDrawer for attributes definition
Handle(Prs3d_LineAspect) aLnAspect = new Prs3d_LineAspect(theColor, Aspect_TOL_SOLID, 1);
myDrawer->SetLineAspect(aLnAspect);
}
} else if (myConstraint->getKind() == SketchPlugin_MultiRotation::ID()) {
// if it is rotation
- AttributePoint2DPtr aCenter = GeomDataAPI_Point2D::getPoint2D(aData, SketchPlugin_MultiRotation::CENTER_ID());
+ AttributePoint2DPtr aCenter =
+ GeomDataAPI_Point2D::getPoint2D(aData, SketchPlugin_MultiRotation::CENTER_ID());
if (aCenter.get() && aCenter->isInitialized()) {
// Show center of rotation
std::shared_ptr<GeomAPI_Pnt> aPnt = myPlane->to3D(aCenter->x(), aCenter->y());