/// Returns True if selected presentation can be selected
/// \param theOwner an owner of the persentation
- Standard_EXPORT virtual Standard_Boolean IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const;
+ Standard_EXPORT virtual Standard_Boolean
+ IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const;
DEFINE_STANDARD_RTTI(PartSet_GlobalFilter)
};
/// Returns True if the given owner is acceptable for selection
/// \param theOwner the selected owner
- Standard_EXPORT virtual Standard_Boolean IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const;
+ Standard_EXPORT virtual Standard_Boolean
+ IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const;
DEFINE_STANDARD_RTTI(PartSet_CirclePointFilter)
const int theRGB[3])
{
double aSize = Config_PropManager::integer(SKETCH_TAB_NAME, "planes_size", PLANE_SIZE);
- std::shared_ptr<GeomAPI_Shape> aFace = GeomAlgoAPI_FaceBuilder::squareFace(theOrigin, theNorm, aSize);
+ std::shared_ptr<GeomAPI_Shape> aFace =
+ GeomAlgoAPI_FaceBuilder::squareFace(theOrigin, theNorm, aSize);
AISObjectPtr aAIS = AISObjectPtr(new GeomAPI_AISObject());
aAIS->createShape(aFace);
aAIS->setWidth(Config_PropManager::integer(SKETCH_TAB_NAME, "planes_thickness", SKETCH_WIDTH));
Handle(V3d_View) aView = theWindow->v3dView();
QList<ModuleBase_ViewerPrsPtr> aList = aSelection->getSelected(ModuleBase_ISelection::Viewer);
- ModuleBase_ViewerPrsPtr aFirstValue = aList.size() > 0 ? aList.first() : ModuleBase_ViewerPrsPtr();
+ ModuleBase_ViewerPrsPtr aFirstValue =
+ aList.size() > 0 ? aList.first() : ModuleBase_ViewerPrsPtr();
if (!aFirstValue.get() && myPreSelected.get()) {
aFirstValue = myPreSelected;
}
bool anOrphanPoint = aShape.ShapeType() == TopAbs_VERTEX ||
isOrphanPoint(aSelectedFeature, mySketch, aX, aY);
if (anExternal) {
- anOrphanPoint = true; // we should not stop reentrant operation on external objects because
+ // we should not stop reentrant operation on external objects because
+ anOrphanPoint = true;
// they are not participate in the contour creation excepting external vertices
if (aShape.ShapeType() == TopAbs_VERTEX) {
FeaturePtr aFixedFeature = ModelAPI_Feature::feature(aFixedObject);
}
}
else {
- // point is taken from mouse event and set in attribute. It should be done before setting
- // coinident constraint to the external line. If a point is created, it should be in the mouse
- // clicked point
- gp_Pnt aPoint = PartSet_Tools::convertClickToPoint(theEvent->pos(), theWindow->v3dView());
+ // point is taken from mouse event and set in attribute.
+ // It should be done before setting
+ // coinident constraint to the external line. If a point is created, it should be
+ // in the mouse clicked point
+ gp_Pnt aPoint =
+ PartSet_Tools::convertClickToPoint(theEvent->pos(), theWindow->v3dView());
double aX, anY;
PartSet_Tools::convertTo2D(aPoint, mySketch, aView, aX, anY);
setPoint(aX, anY);
}
if (aFixedObject.get())
setConstraintWith(aFixedObject);
- // fignal updated should be flushed in order to visualize possible created external objects
- // e.g. selection of trihedron axis when input end arc point
+ // fignal updated should be flushed in order to visualize possible created
+ // external objects e.g. selection of trihedron axis when input end arc point
updateObject(feature());
if (!anOrphanPoint)
}
else if (aShape.ShapeType() == TopAbs_EDGE) {
// point is taken from mouse event and set in attribute. It should be done before setting
- // coinident constraint to the external line. If a point is created, it should be in the mouse
- // clicked point
+ // coinident constraint to the external line. If a point is created, it should be in
+ // the mouse clicked point
gp_Pnt aPoint = PartSet_Tools::convertClickToPoint(theEvent->pos(), theWindow->v3dView());
PartSet_Tools::convertTo2D(aPoint, mySketch, aView, aX, aY);
setPoint(aX, aY);
}
}
-void PartSet_WidgetPoint2D::setPreSelection(const std::shared_ptr<ModuleBase_ViewerPrs>& thePreSelected)
+void PartSet_WidgetPoint2D::setPreSelection(
+ const std::shared_ptr<ModuleBase_ViewerPrs>& thePreSelected)
{
myPreSelected = thePreSelected;
}
FeaturePtr aSelectedFeature = ModelAPI_Feature::feature(theObject);
std::shared_ptr<SketchPlugin_Feature> aSPFeature =
std::dynamic_pointer_cast<SketchPlugin_Feature>(aSelectedFeature);
- // there is no a sketch feature is selected, but the shape exists, try to create an exernal object
+ // there is no a sketch feature is selected, but the shape exists,
+ // try to create an exernal object
// TODO: unite with the same functionality in PartSet_WidgetShapeSelector
if (aSPFeature.get() == NULL) {
ObjectPtr anExternalObject = ObjectPtr();
aShape = aResult->shape();
}
if (aShape.get() != NULL && !aShape->isNull())
- anExternalObject = myExternalObjectMgr->externalObject(theObject, aShape, sketch(), myIsInValidate);
+ anExternalObject =
+ myExternalObjectMgr->externalObject(theObject, aShape, sketch(), myIsInValidate);
}
else { /// use objects of found selection
anExternalObject = theObject;
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
// Name : PartSetAPI_Part.cpp
// Purpose:
//
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
// Name : PartSetAPI_Part.h
// Purpose:
//
aRoot->refsToFeature(aFeature, aRefFeatures);
if (aRefFeatures.empty()) {
aRoot->removeFeature(aFeature);
- // the redisplay signal should be flushed in order to erase the feature presentation in the viewer
- // after removeFeature from the document
+ // the redisplay signal should be flushed in order to erase the feature presentation
+ // in the viewer after removeFeature from the document
Events_Loop::loop()->flush(Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY));
}
}
INTERFACE_6(PrimitivesPlugin_Box::ID(),
creationMethod, PrimitivesPlugin_Box::CREATION_METHOD(),
ModelAPI_AttributeString, /** Creation method */,
- dx, PrimitivesPlugin_Box::DX_ID(), ModelAPI_AttributeDouble, /** Dimension in X */,
- dy, PrimitivesPlugin_Box::DY_ID(), ModelAPI_AttributeDouble, /** Dimension in Y */,
- dz, PrimitivesPlugin_Box::DZ_ID(), ModelAPI_AttributeDouble, /** Dimension in Z */,
- firstPoint, PrimitivesPlugin_Box::POINT_FIRST_ID(), ModelAPI_AttributeSelection, /** First point */,
- secondPoint, PrimitivesPlugin_Box::POINT_SECOND_ID(), ModelAPI_AttributeSelection, /** Second point */)
+ dx, PrimitivesPlugin_Box::DX_ID(),
+ ModelAPI_AttributeDouble, /** Dimension in X */,
+ dy, PrimitivesPlugin_Box::DY_ID(),
+ ModelAPI_AttributeDouble, /** Dimension in Y */,
+ dz, PrimitivesPlugin_Box::DZ_ID(),
+ ModelAPI_AttributeDouble, /** Dimension in Z */,
+ firstPoint, PrimitivesPlugin_Box::POINT_FIRST_ID(),
+ ModelAPI_AttributeSelection, /** First point */,
+ secondPoint, PrimitivesPlugin_Box::POINT_SECOND_ID(),
+ ModelAPI_AttributeSelection, /** Second point */)
/// Set dimensions
PRIMITIVESAPI_EXPORT
data()->addAttribute(PrimitivesPlugin_Box::DY_ID(), ModelAPI_AttributeDouble::typeId());
data()->addAttribute(PrimitivesPlugin_Box::DZ_ID(), ModelAPI_AttributeDouble::typeId());
- data()->addAttribute(PrimitivesPlugin_Box::POINT_FIRST_ID(), ModelAPI_AttributeSelection::typeId());
- data()->addAttribute(PrimitivesPlugin_Box::POINT_SECOND_ID(), ModelAPI_AttributeSelection::typeId());
+ data()->addAttribute(PrimitivesPlugin_Box::POINT_FIRST_ID(),
+ ModelAPI_AttributeSelection::typeId());
+ data()->addAttribute(PrimitivesPlugin_Box::POINT_SECOND_ID(),
+ ModelAPI_AttributeSelection::typeId());
}
//=================================================================================================
std::shared_ptr<GeomAlgoAPI_Box> aBoxAlgo(new GeomAlgoAPI_Box(aDx,aDy,aDz));
- // These checks should be made to the GUI for the feature but the corresponding validator does not exist yet.
+ // These checks should be made to the GUI for the feature but
+ // the corresponding validator does not exist yet.
if (!aBoxAlgo->check()) {
// The error is not displayed in a popup window. It must be in the status bar.
setError(aBoxAlgo->getError(), false);
if (aShape1 && aShape2){
std::shared_ptr<GeomAPI_Pnt> aFirstPoint = GeomAlgoAPI_PointBuilder::point(aShape1);
std::shared_ptr<GeomAPI_Pnt> aSecondPoint = GeomAlgoAPI_PointBuilder::point(aShape2);
- aBoxAlgo = std::shared_ptr<GeomAlgoAPI_BoxPoints>(new GeomAlgoAPI_BoxPoints(aFirstPoint,aSecondPoint));
+ aBoxAlgo = std::shared_ptr<GeomAlgoAPI_BoxPoints>(
+ new GeomAlgoAPI_BoxPoints(aFirstPoint,aSecondPoint));
}
}
- // These checks should be made to the GUI for the feature but the corresponding validator does not exist yet.
+ // These checks should be made to the GUI for the feature but
+ // the corresponding validator does not exist yet.
if (!aBoxAlgo->check()) {
// The error is not displayed in a popup window. It must be in the message console.
setError(aBoxAlgo->getError(), false);
// Insert to faces
int num = 1;
- std::map< std::string, std::shared_ptr<GeomAPI_Shape> > listOfFaces = theBoxAlgo->getCreatedFaces();
- for (std::map< std::string, std::shared_ptr<GeomAPI_Shape> >::iterator it=listOfFaces.begin(); it!=listOfFaces.end(); ++it) {
+ std::map< std::string, std::shared_ptr<GeomAPI_Shape> > listOfFaces =
+ theBoxAlgo->getCreatedFaces();
+ for (std::map< std::string, std::shared_ptr<GeomAPI_Shape> >::iterator
+ it=listOfFaces.begin(); it!=listOfFaces.end(); ++it) {
std::shared_ptr<GeomAPI_Shape> aFace = (*it).second;
theResultBox->generated(aFace, (*it).first, num++);
}
theTypes = myModelWidgetTypes;
}
-ModuleBase_ModelWidget* SamplePanelPlugin_ModelWidgetCreator::createWidgetByType(const std::string& theType,
+ModuleBase_ModelWidget* SamplePanelPlugin_ModelWidgetCreator::createWidgetByType(
+ const std::string& theType,
QWidget* theParent,
Config_WidgetAPI* theWidgetApi,
ModuleBase_IWorkshop* /*theWorkshop*/)
aWidgetCreatorFactory->registerCreator(
std::shared_ptr<SamplePanelPlugin_WidgetCreator>(new SamplePanelPlugin_WidgetCreator()));
aWidgetCreatorFactory->registerCreator(
- std::shared_ptr<SamplePanelPlugin_ModelWidgetCreator>(new SamplePanelPlugin_ModelWidgetCreator()));
+ std::shared_ptr<SamplePanelPlugin_ModelWidgetCreator>(
+ new SamplePanelPlugin_ModelWidgetCreator()));
// register this plugin
ModelAPI_Session::get()->registerPlugin(this);