{
static const std::string MY_GROUP_ID("GroupAddition");
return MY_GROUP_ID;
- }
+ }
/// Returns the kind of a feature
COLLECTIONPLUGIN_EXPORT virtual const std::string& getKind()
aGroup->store(aCompound);
// update the type of selection
- updateGroupType(LIST_ID());
+ updateGroupType(LIST_ID());
}
*/
class CollectionPlugin_GroupMerge: public CollectionPlugin_GroupOperation
{
-public:
+public:
/// attribute name of selected entities list
inline static const std::string& LIST_ID()
{
#include <TopoDS_Iterator.hxx>
void CollectionPlugin_GroupShape::execute()
-{
+{
ResultGroupPtr aGroup;
CollectionPlugin_GroupMerge::execute(aGroup);
GeomShapePtr aCompound = aGroup->shape();
{
static const std::string MY_GROUP_ID("GroupShape");
return MY_GROUP_ID;
- }
+ }
/// Returns the kind of a feature
COLLECTIONPLUGIN_EXPORT virtual const std::string& getKind()
removeResults(1); // for case the point type was switched from multi-results type
std::shared_ptr<ModelAPI_ResultConstruction> aConstr = document()->createConstruction(data());
aConstr->setInfinite(true);
- aConstr->setShape(aShape);
+ aConstr->setShape(aShape);
+ /// set point color
aConstr->setColor(ModelAPI_ResultConstruction::ModelApi_PointColor::DEFAULT_COLOR(),
- ModelAPI_ResultConstruction::ModelApi_PointColor::COLOR_CONFIG_NAME()); /// set point color
+ ModelAPI_ResultConstruction::ModelApi_PointColor::COLOR_CONFIG_NAME());
setResult(aConstr);
}
FeaturePtr aBase = feature();
std::string aPartName = theDumper.name(aBase->document());
- std::string aFilePath = aBase->string(ExchangePlugin_Import_ImageFeature::FILE_PATH_ID())->value();
+ std::string aFilePath =
+ aBase->string(ExchangePlugin_Import_ImageFeature::FILE_PATH_ID())->value();
theDumper << aBase << " = model.addImportImage(" << aPartName << ", \""
<< aFilePath << "\")" << std::endl;
{
data()->addAttribute(FILE_PATH_ID(), ModelAPI_AttributeString::typeId());
data()->addAttribute(TARGET_PART_ID(), ModelAPI_AttributeInteger::typeId());
- data()->addAttribute(TARGET_PARTS_LIST_ID(), ModelAPI_AttributeStringArray::typeId());
+ data()->addAttribute(TARGET_PARTS_LIST_ID(), ModelAPI_AttributeStringArray::typeId());
}
void ExchangePlugin_Import::initAttributes()
ExchangePlugin_ImportBase::initAttributes();
data()->addAttribute(STEP_FILE_PATH_ID(), ModelAPI_AttributeString::typeId());
- data()->addAttribute(IMPORT_TYPE_ID(), ModelAPI_AttributeString::typeId());
+ data()->addAttribute(IMPORT_TYPE_ID(), ModelAPI_AttributeString::typeId());
data()->addAttribute(STEP_TARGET_PART_ID(), ModelAPI_AttributeInteger::typeId());
data()->addAttribute(STEP_TARGET_PARTS_LIST_ID(), ModelAPI_AttributeStringArray::typeId());
data()->addAttribute(STEP_MATERIALS_ID(), ModelAPI_AttributeBoolean::typeId());
if (aDoc.get()) {
FeaturePtr aImportFeature = aDoc->addFeature(ExchangePlugin_Import_ImageFeature::ID());
DataPtr aData = aImportFeature->data();
- AttributeStringPtr aPathAttr = aData->string(ExchangePlugin_Import_ImageFeature::FILE_PATH_ID());
+ AttributeStringPtr aPathAttr =
+ aData->string(ExchangePlugin_Import_ImageFeature::FILE_PATH_ID());
aPathAttr->setValue(aFilePathAttr->value());
aImportFeature->execute();
}
*/
class ExchangePlugin_ImportBase : public ModelAPI_Feature
{
- public:
+ public:
/// attribute name of file path
inline static const std::string& FILE_PATH_ID()
{
void ExchangePlugin_ImportFeature::initAttributes()
{
ExchangePlugin_ImportFeatureBase::initAttributes();
-
+
data()->addAttribute(STEP_FILE_PATH_ID(), ModelAPI_AttributeString::typeId());
data()->addAttribute(IMPORT_TYPE_ID(), ModelAPI_AttributeString::typeId());
data()->addAttribute(STEP_MATERIALS_ID(), ModelAPI_AttributeBoolean::typeId());
data()->addAttribute(STEP_COLORS_ID(), ModelAPI_AttributeBoolean::typeId());
data()->addAttribute(STEP_SCALE_INTER_UNITS_ID(), ModelAPI_AttributeBoolean::typeId());
-
+
ModelAPI_Session::get()->validators()->registerNotObligatory(
getKind(), ExchangePlugin_ImportFeature::STEP_COLORS_ID());
ModelAPI_Session::get()->validators()->registerNotObligatory(
}
// Pass the results into the model
-
loadNamingDS(aGeomShape, aResult);
// create color group
/// Performs the import of XAO file
EXCHANGEPLUGIN_EXPORT void importXAO(const std::string& theFileName);
-private:
+private:
/// Set groups of color
void setColorGroups(std::shared_ptr<ModelAPI_ResultBody> theResultBody);
void FeaturesPlugin_Symmetry::buildResult(
const std::shared_ptr<GeomAlgoAPI_MakeShapeList>& theAlgo,
const std::list<std::shared_ptr<GeomAPI_Shape> >& theOriginalShapes,
- std::shared_ptr<GeomAPI_Shape> theTargetShape, int& theResultIndex, std::string & theTextureFile)
+ std::shared_ptr<GeomAPI_Shape> theTargetShape, int& theResultIndex,
+ std::string & theTextureFile)
{
// Store and name the result.
ResultBodyPtr aResultBody = document()->createBody(data(), theResultIndex);
}
//==================================================================================================
-bool FeaturesPlugin_Tools::shapesFromSelectionList(const std::shared_ptr<ModelAPI_AttributeSelectionList> theSelectionList,
+bool FeaturesPlugin_Tools::shapesFromSelectionList(
+ const std::shared_ptr<ModelAPI_AttributeSelectionList> theSelectionList,
const bool theStoreFullHierarchy,
GeomAPI_ShapeHierarchy& theHierarchy,
std::list<ResultPtr>& theParts, std::string &theTextureFile)
auto anObjectAttr = theSelectionList->value(0);
if(anObjectAttr.get())
{
- FeaturePtr aFeature = anObjectAttr->contextFeature();
+ FeaturePtr aFeature = anObjectAttr->contextFeature();
if(aFeature.get() && aFeature->results().size() == 1)
{
theTextureFile = aFeature->firstResult()->getTextureFile();
aTriVertexes[2] = BRepBuilderAPI_MakeVertex (aPnt3);
aTriVertexes[3] = BRepBuilderAPI_MakeVertex (aPnt4);
- aWire = BRepBuilderAPI_MakePolygon (aTriVertexes[0], aTriVertexes[1], aTriVertexes[2], aTriVertexes[3], Standard_True);
+ aWire = BRepBuilderAPI_MakePolygon (aTriVertexes[0], aTriVertexes[1], aTriVertexes[2],
+ aTriVertexes[3], Standard_True);
BRepBuilderAPI_Sewing aSewingTool;
aSewingTool.Init (1.0e-06, Standard_True);
}
std::shared_ptr<GeomAPI_Shape> aGeomShape(new GeomAPI_Shape);
- aGeomShape->setImpl(new TopoDS_Shape(aResShape));
+ aGeomShape->setImpl(new TopoDS_Shape(aResShape));
return aGeomShape;
}
}
double GeomAlgoAPI_ShapeTools::minimalDistance(const GeomShapePtr& theShape1,
- const GeomShapePtr& theShape2, std::array<double, 3> & fromShape1To2)
+ const GeomShapePtr& theShape2,
+ std::array<double, 3> & fromShape1To2)
{
BRepExtrema_DistShapeShape aDist = getExtemaDistShape(theShape1, theShape2);
const auto & pt1 = aDist.PointOnShape1(1);
GEOMALGOAPI_EXPORT static double minimalDistance(const GeomShapePtr& theShape1,
const GeomShapePtr& theShape2);
GEOMALGOAPI_EXPORT static double minimalDistance(const GeomShapePtr& theShape1,
- const GeomShapePtr& theShape2, std::array<double, 3> & fromShape1To2);
+ const GeomShapePtr& theShape2,
+ std::array<double, 3> & fromShape1To2);
/// \brief Combines faces with common edges to shells, or solids to compsolids.
/// \param[in] theCompound compound of shapes.
std::vector<ModuleBase_ViewerPrsPtr> aRemove;
- if (myFeatureId == BuildPlugin_Face::ID() && shapeTypes.find(GeomAPI_Shape::FACE) != shapeTypes.end())
+ if (myFeatureId == BuildPlugin_Face::ID() && shapeTypes.find(GeomAPI_Shape::FACE)
+ != shapeTypes.end())
{
for(auto aSelection: aSelected){
auto aType = aSelection->shape()->shapeType();
aRemove.push_back(aSelection);
}
}
- else if (myFeatureId == BuildPlugin_Wire::ID() && shapeTypes.find(GeomAPI_Shape::WIRE) != shapeTypes.end())
+ else if (myFeatureId == BuildPlugin_Wire::ID() && shapeTypes.find(GeomAPI_Shape::WIRE)
+ != shapeTypes.end())
{
for(auto aSelection: aSelected){
auto aType = aSelection->shape()->shapeType();
"Construction color", Config_Prop::Color,
ModelAPI_ResultConstruction::DEFAULT_COLOR());
- Config_PropManager::registerProp("Visualization",
- ModelAPI_ResultConstruction::ModelApi_PointColor::COLOR_CONFIG_NAME(),
- "Construction point color", Config_Prop::Color,
- ModelAPI_ResultConstruction::ModelApi_PointColor::DEFAULT_COLOR());
+ Config_PropManager::registerProp(
+ "Visualization",
+ ModelAPI_ResultConstruction::ModelApi_PointColor::COLOR_CONFIG_NAME(),
+ "Construction point color", Config_Prop::Color,
+ ModelAPI_ResultConstruction::ModelApi_PointColor::DEFAULT_COLOR());
Config_PropManager::registerProp("Visualization", "result_part_color", "Part color",
#include <ModelHighAPI_Tools.h>
//==================================================================================================
-SketchAPI_MacroRectangle::SketchAPI_MacroRectangle(const std::shared_ptr<ModelAPI_Feature>& theFeature)
+SketchAPI_MacroRectangle::SketchAPI_MacroRectangle(
+ const std::shared_ptr<ModelAPI_Feature>& theFeature)
: SketchAPI_SketchEntity(theFeature)
{
initialize();
}
//==================================================================================================
-SketchAPI_MacroRectangle::SketchAPI_MacroRectangle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- double theStartX,
- double theStartY,
- double theSecondX,
- double theSecondY, bool isFirstPointCenter):
+SketchAPI_MacroRectangle::SketchAPI_MacroRectangle(
+ const std::shared_ptr<ModelAPI_Feature>& theFeature,
+ double theStartX,
+ double theStartY,
+ double theSecondX,
+ double theSecondY,
+ bool isFirstPointCenter):
SketchAPI_SketchEntity(theFeature)
{
if(initialize()) {
}
//==================================================================================================
-SketchAPI_MacroRectangle::SketchAPI_MacroRectangle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::shared_ptr<GeomAPI_Pnt2d>& theStartPoint,
- const std::shared_ptr<GeomAPI_Pnt2d>& theSecondPoint, bool isFirstPointCenter):
+SketchAPI_MacroRectangle::SketchAPI_MacroRectangle(
+ const std::shared_ptr<ModelAPI_Feature>& theFeature,
+ const std::shared_ptr<GeomAPI_Pnt2d>& theStartPoint,
+ const std::shared_ptr<GeomAPI_Pnt2d>& theSecondPoint, bool isFirstPointCenter):
SketchAPI_SketchEntity(theFeature)
{
if(initialize()) {
}
//==================================================================================================
-void SketchAPI_MacroRectangle::setByStartAndEndPoints(const std::shared_ptr<GeomAPI_Pnt2d>& theStartPoint,
- const std::shared_ptr<GeomAPI_Pnt2d>& theEndPoint)
+void SketchAPI_MacroRectangle::setByStartAndEndPoints(
+ const std::shared_ptr<GeomAPI_Pnt2d>& theStartPoint,
+ const std::shared_ptr<GeomAPI_Pnt2d>& theEndPoint)
{
fillAttribute(SketchPlugin_MacroRectangle::START_END_POINT_TYPE_ID(), rectangleType());
fillAttribute(theStartPoint, startPoint1());
}
//==================================================================================================
-void SketchAPI_MacroRectangle::setByCenterAndEndPoints(double theCenterX, double theCenterY, double theEndX, double theEndY)
+void SketchAPI_MacroRectangle::setByCenterAndEndPoints(double theCenterX, double theCenterY,
+ double theEndX, double theEndY)
{
fillAttribute(SketchPlugin_MacroRectangle::CENTER_END_POINT_TYPE_ID(), rectangleType());
fillAttribute(endPoint2(), theEndX, theEndY);
}
//==================================================================================================
-void SketchAPI_MacroRectangle::setByCenterAndEndPoints(const std::shared_ptr<GeomAPI_Pnt2d>& theCenterPoint, const std::shared_ptr<GeomAPI_Pnt2d>& theEndPoint){
+void SketchAPI_MacroRectangle::setByCenterAndEndPoints(
+ const std::shared_ptr<GeomAPI_Pnt2d>& theCenterPoint,
+ const std::shared_ptr<GeomAPI_Pnt2d>& theEndPoint){
fillAttribute(SketchPlugin_MacroRectangle::CENTER_END_POINT_TYPE_ID(), rectangleType());
fillAttribute(theEndPoint, endPoint2());
fillAttribute(theCenterPoint, centerPoint());
SKETCHAPI_EXPORT
SketchAPI_MacroRectangle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::shared_ptr<GeomAPI_Pnt2d>& theStartPoint,
- const std::shared_ptr<GeomAPI_Pnt2d>& theSecondPoint, bool isFirstPointCenter = false);
+ const std::shared_ptr<GeomAPI_Pnt2d>& theSecondPoint,
+ bool isFirstPointCenter = false);
/// Destructor.
}
SketchAPI_Rectangle::SketchAPI_Rectangle(const std::shared_ptr<ModelAPI_Feature> & theFeature,
- double theX1, double theY1, double theX2, double theY2, bool isFirstPointCenter)
+ double theX1, double theY1, double theX2, double theY2,
+ bool isFirstPointCenter)
: SketchAPI_SketchEntity(theFeature)
{
if (initialize()) {
SketchAPI_Rectangle::SketchAPI_Rectangle(const std::shared_ptr<ModelAPI_Feature> & theFeature,
const std::shared_ptr<GeomAPI_Pnt2d> & theFirstPoint,
- const std::shared_ptr<GeomAPI_Pnt2d> & theEndPoint, bool isFirstPointCenter)
+ const std::shared_ptr<GeomAPI_Pnt2d> & theEndPoint,
+ bool isFirstPointCenter)
: SketchAPI_SketchEntity(theFeature)
{
if (initialize()) {
//--------------------------------------------------------------------------------------
void SketchAPI_Rectangle::setByCoordinates(
double theX1, double theY1, double theX2, double theY2, bool isFirstPointCenter)
-{
+{
if(isFirstPointCenter){
fillAttribute(centerPoint(), theX1, theY1);
double xStart = 2.0*theX1 - theX2;
}
void SketchAPI_Rectangle::setByPoints(const std::shared_ptr<GeomAPI_Pnt2d> & theFirstPoint,
- const std::shared_ptr<GeomAPI_Pnt2d> & theSecondPoint, bool isFirstPointCenter)
+ const std::shared_ptr<GeomAPI_Pnt2d> & theSecondPoint,
+ bool isFirstPointCenter)
{
if(isFirstPointCenter){
fillAttribute(theFirstPoint, centerPoint());
/// do not dump sub-features eg: lines and lines constraints
AttributeRefListPtr noToDumpList = aBase->reflist(SketchPlugin_Rectangle::NOT_TO_DUMP_LIST_ID());
for( int i = 0; i < noToDumpList->size(); i++){
- theDumper.doNotDumpFeature(std::dynamic_pointer_cast<ModelAPI_Feature>(noToDumpList->object(i)));
+ theDumper.doNotDumpFeature(
+ std::dynamic_pointer_cast<ModelAPI_Feature>(noToDumpList->object(i)));
}
if (isCopy())
const std::string& aSketchName = theDumper.parentName(aBase);
- FeaturePtr aCenterPointFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aBase->refattr(SketchPlugin_Rectangle::CENTER_REF_ID())->object());
+ FeaturePtr aCenterPointFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(
+ aBase->refattr(SketchPlugin_Rectangle::CENTER_REF_ID())->object());
if(aCenterPointFeature){
// rectangle has center
theDumper << aBase << " = " << aSketchName << ".addRectangle("
/// Constructor with values
SKETCHAPI_EXPORT
SketchAPI_Rectangle(const std::shared_ptr<ModelAPI_Feature> & theFeature,
- double theX1, double theY1, double theX2, double theY2, bool isFirstPointCenter = false);
+ double theX1, double theY1, double theX2, double theY2,
+ bool isFirstPointCenter = false);
/// Constructor with values
SKETCHAPI_EXPORT
SketchAPI_Rectangle(const std::shared_ptr<ModelAPI_Feature> & theFeature,
const std::shared_ptr<GeomAPI_Pnt2d> & theFirstPoint,
- const std::shared_ptr<GeomAPI_Pnt2d> & theEndPoint, bool isFirstPointCenter = false);
+ const std::shared_ptr<GeomAPI_Pnt2d> & theEndPoint,
+ bool isFirstPointCenter = false);
/// Destructor
SKETCHAPI_EXPORT
virtual ~SketchAPI_Rectangle();
INTERFACE_4(SketchPlugin_Rectangle::ID(),
- startPoint, SketchPlugin_Rectangle::START_ID(), GeomDataAPI_Point2D, /** Start point */,
- endPoint, SketchPlugin_Rectangle::END_ID(), GeomDataAPI_Point2D, /** End point */,
- centerPoint, SketchPlugin_Rectangle::CENTER_ID(), GeomDataAPI_Point2D, /** Center point */,
- linesList, SketchPlugin_Rectangle::LINES_LIST_ID(), ModelAPI_AttributeRefList, /** Lines list */
+ startPoint, SketchPlugin_Rectangle::START_ID(), GeomDataAPI_Point2D,
+ /** Start point */,
+ endPoint, SketchPlugin_Rectangle::END_ID(), GeomDataAPI_Point2D,
+ /** End point */,
+ centerPoint, SketchPlugin_Rectangle::CENTER_ID(), GeomDataAPI_Point2D,
+ /** Center point */,
+ linesList, SketchPlugin_Rectangle::LINES_LIST_ID(), ModelAPI_AttributeRefList,
+ /** Lines list */
)
/// Set by coordinates
SKETCHAPI_EXPORT
- void setByCoordinates(double theX1, double theY1, double theX2, double theY2, bool isFirstPointCenter);
+ void setByCoordinates(double theX1, double theY1, double theX2, double theY2,
+ bool isFirstPointCenter);
/// Set by points
SKETCHAPI_EXPORT
{
std::shared_ptr<ModelAPI_Feature> aFeature =
compositeFeature()->addFeature(SketchAPI_Rectangle::ID());
- return RectanglePtr(new SketchAPI_Rectangle(aFeature, theX1, theY1, theX2, theY2, isFirstPointCenter));
+ return RectanglePtr(new SketchAPI_Rectangle(aFeature, theX1, theY1,
+ theX2, theY2, isFirstPointCenter));
}
std::shared_ptr<SketchAPI_Rectangle> SketchAPI_Sketch::addRectangle(
const std::shared_ptr<GeomAPI_Pnt2d> & theFirstPoint,
{
std::shared_ptr<ModelAPI_Feature> aFeature =
compositeFeature()->addFeature(SketchAPI_Rectangle::ID());
- return RectanglePtr(new SketchAPI_Rectangle(aFeature, theFirstPoint, theEndPoint, isFirstPointCenter));
+ return RectanglePtr(new SketchAPI_Rectangle(aFeature, theFirstPoint, theEndPoint,
+ isFirstPointCenter));
}
std::shared_ptr<SketchAPI_Rectangle> SketchAPI_Sketch::addRectangleCentered(
SketchPlugin_MacroRectangle::SketchPlugin_MacroRectangle()
: SketchPlugin_SketchEntity(), myHasCenterPoint(false)
-{
-}
+{}
void SketchPlugin_MacroRectangle::initAttributes()
{
if(myHasCenterPoint){
std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
- myRectangleFeature->attribute(SketchPlugin_Rectangle::CENTER_ID()))->setValue(myCenterPoint->x(),
- myCenterPoint->y());
+ myRectangleFeature->attribute(
+ SketchPlugin_Rectangle::CENTER_ID()))->setValue(myCenterPoint->x(),
+ myCenterPoint->y());
}
std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
- myRectangleFeature->attribute(SketchPlugin_Rectangle::START_ID()))->setValue(myStartPoint->x(),
- myStartPoint->y());
+ myRectangleFeature->attribute(
+ SketchPlugin_Rectangle::START_ID()))->setValue(myStartPoint->x(),
+ myStartPoint->y());
std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
- myRectangleFeature->attribute(SketchPlugin_Rectangle::END_ID()))->setValue(myEndPoint->x(),
- myEndPoint->y());
+ myRectangleFeature->attribute(
+ SketchPlugin_Rectangle::END_ID()))->setValue(myEndPoint->x(),
+ myEndPoint->y());
myRectangleFeature->boolean(SketchPlugin_Rectangle::AUXILIARY_ID())
->setValue(boolean(AUXILIARY_ID())->value());
myRectangleFeature->execute();
/// create coincidences with rectangle start/center and end points
- AttributeRefListPtr aLinesList = myRectangleFeature->reflist(SketchPlugin_Rectangle::LINES_LIST_ID());
- FeaturePtr aRectangleStartLineFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aLinesList->object(0));
- FeaturePtr aRectangleEndLineFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aLinesList->object(2));
+ AttributeRefListPtr aLinesList =
+ myRectangleFeature->reflist(SketchPlugin_Rectangle::LINES_LIST_ID());
+ FeaturePtr aRectangleStartLineFeature =
+ std::dynamic_pointer_cast<ModelAPI_Feature>(aLinesList->object(0));
+ FeaturePtr aRectangleEndLineFeature =
+ std::dynamic_pointer_cast<ModelAPI_Feature>(aLinesList->object(2));
std::shared_ptr<GeomDataAPI_Point2D> aRectanglePointEndAttr =
- std::dynamic_pointer_cast<GeomDataAPI_Point2D>(aRectangleEndLineFeature->attribute(SketchPlugin_Line::END_ID()));
+ std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+ aRectangleEndLineFeature->attribute(SketchPlugin_Line::END_ID()));
std::shared_ptr<GeomDataAPI_Point2D> aRectanglePointStartAttr =
- std::dynamic_pointer_cast<GeomDataAPI_Point2D>(aRectangleStartLineFeature->attribute(SketchPlugin_Line::END_ID()));
+ std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+ aRectangleStartLineFeature->attribute(SketchPlugin_Line::END_ID()));
if(myHasCenterPoint){
- FeaturePtr aCenterPointFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(myRectangleFeature->refattr(CENTER_REF_ID())->object());
+ FeaturePtr aCenterPointFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(
+ myRectangleFeature->refattr(CENTER_REF_ID())->object());
SketchPlugin_Tools::createCoincidenceOrTangency(
this, CENTER_REF_ID(), AttributePtr(), aCenterPointFeature, false);
SketchPlugin_Tools::createCoincidenceOrTangency(
{
FeaturePtr aLine = std::dynamic_pointer_cast<ModelAPI_Feature>(aLinesList->object(i));
std::shared_ptr<GeomDataAPI_Point2D> aLineStart =
- std::dynamic_pointer_cast<GeomDataAPI_Point2D>(aLine->attribute(SketchPlugin_Line::START_ID()));
+ std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+ aLine->attribute(SketchPlugin_Line::START_ID()));
std::shared_ptr<GeomDataAPI_Point2D> aLineEnd =
- std::dynamic_pointer_cast<GeomDataAPI_Point2D>(aLine->attribute(SketchPlugin_Line::END_ID()));
+ std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+ aLine->attribute(SketchPlugin_Line::END_ID()));
aLineStart->setValue(aX[(i+3)%4], aY[(i+3)%4]);
aLineEnd->setValue(aX[i], aY[i]);
aLine->data()->boolean(AUXILIARY_ID())->setValue(anAuxiliary);
if(aDiagonalList->size())
{
auto aDiagonalPoint = cornerToDiagonalLinePoints[i];
- FeaturePtr aDiagonal = std::dynamic_pointer_cast<ModelAPI_Feature>(aDiagonalList->object(aDiagonalPoint.first));
- std::dynamic_pointer_cast<GeomDataAPI_Point2D>(aDiagonal->attribute(aDiagonalPoint.second))->setValue(aX[(i+3)%4], aY[(i+3)%4]);
+ FeaturePtr aDiagonal = std::dynamic_pointer_cast<ModelAPI_Feature>(
+ aDiagonalList->object(aDiagonalPoint.first));
+ std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+ aDiagonal->attribute(aDiagonalPoint.second))->setValue(aX[(i+3)%4], aY[(i+3)%4]);
}
}
}
{
FeaturePtr aLine = std::dynamic_pointer_cast<ModelAPI_Feature>(aLinesList->object(i));
std::shared_ptr<GeomDataAPI_Point2D> aLineStart =
- std::dynamic_pointer_cast<GeomDataAPI_Point2D>(aLine->attribute(SketchPlugin_Line::END_ID()));
+ std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+ aLine->attribute(SketchPlugin_Line::END_ID()));
aLineStart->setValue(aXStart, aYStart);
}
}
for(int i = 0; i < 2; i++)
{
- FeaturePtr aDiagonal = std::dynamic_pointer_cast<ModelAPI_Feature>(aDiagonalList->object(i));
- FeaturePtr aConstraint = SketchPlugin_Tools::createConstraintAttrObject(aSketch, SketchPlugin_ConstraintCoincidence::ID(),
- aCoord, aDiagonal);
+ FeaturePtr aDiagonal = std::dynamic_pointer_cast<ModelAPI_Feature>(
+ aDiagonalList->object(i));
+ FeaturePtr aConstraint = SketchPlugin_Tools::createConstraintAttrObject(
+ aSketch, SketchPlugin_ConstraintCoincidence::ID(),
+ aCoord, aDiagonal);
aNotToDumpList->append(aConstraint);
}
}
/// connect neighbor lines by coincidence
unsigned iPrev = (i+3)%4;
FeaturePtr aPrevLine = std::dynamic_pointer_cast<ModelAPI_Feature>(aLinesList->object(iPrev));
- FeaturePtr aConstraint = SketchPlugin_Tools::createConstraintAttrAttr(aSketch, SketchPlugin_ConstraintCoincidence::ID(),
- aPrevLine->attribute(SketchPlugin_Line::END_ID()),
- aLine->attribute(SketchPlugin_Line::START_ID()));
+ FeaturePtr aConstraint = SketchPlugin_Tools::createConstraintAttrAttr(
+ aSketch, SketchPlugin_ConstraintCoincidence::ID(),
+ aPrevLine->attribute(SketchPlugin_Line::END_ID()),
+ aLine->attribute(SketchPlugin_Line::START_ID()));
aNotToDumpList->append(aConstraint);
/// case of rectangle created from its center
if(aDiagonalList->size())
{
auto aDiagonalPoint = cornerToDiagonalLinePoints[i];
- FeaturePtr aDiagonal = std::dynamic_pointer_cast<ModelAPI_Feature>(aDiagonalList->object(aDiagonalPoint.first));
- FeaturePtr aConstraint = SketchPlugin_Tools::createConstraintAttrAttr(aSketch, SketchPlugin_ConstraintCoincidence::ID(),
- aDiagonal->attribute(aDiagonalPoint.second),
- aLine->attribute(SketchPlugin_Line::START_ID()));
+ FeaturePtr aDiagonal = std::dynamic_pointer_cast<ModelAPI_Feature>(
+ aDiagonalList->object(aDiagonalPoint.first));
+ FeaturePtr aConstraint = SketchPlugin_Tools::createConstraintAttrAttr(
+ aSketch, SketchPlugin_ConstraintCoincidence::ID(),
+ aDiagonal->attribute(aDiagonalPoint.second),
+ aLine->attribute(SketchPlugin_Line::START_ID()));
aNotToDumpList->append(aConstraint);
}
}
aSubs.push_back(aDiagonalResult->shape());
}
- FeaturePtr aCenterPointFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(refattr(CENTER_REF_ID())->object());
+ FeaturePtr aCenterPointFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(
+ refattr(CENTER_REF_ID())->object());
if(aCenterPointFeature)
{
ResultPtr aCenterResult = aCenterPointFeature->lastResult();
private:
/// \brief updateLines crates lines from start and en points
- void updateLines();
- void updateStartPoint();
+ void updateLines();
+ void updateStartPoint();
};