if (!aDimAIS.IsNull()) {
aDimAIS->DimensionAspect()->SetCommonColor(aColor);
}
+ Handle(AIS_InteractiveContext) aContext = anAIS->GetContext();
+ aContext->SetColor(anAIS, aColor, false);
}
void GeomAPI_AISObject::setWidth(const double& theWidth)
if (!aDimAIS.IsNull()) {
aDimAIS->DimensionAspect()->SetCommonColor(aColor);
}
+ Handle(AIS_InteractiveContext) aContext = anAIS->GetContext();
+ aContext->SetColor(anAIS, aColor, false);
}
bool GeomAPI_AISObject::empty() const
{
registerValidators();
registerFilters();
+ registerProperties();
Config_ModuleReader aXMLReader = Config_ModuleReader();
aXMLReader.readAll();
/// Register selection filters for this module\r
virtual void registerFilters() {}\r
\r
+ /// Register properties of this module\r
+ virtual void registerProperties() {}\r
+\r
/// Returns new instance of operation object (used in createOperation for customization)\r
virtual ModuleBase_Operation* getNewOperation(const std::string& theFeatureId);\r
\r
//#include <SketchPlugin_ConstraintRigid.h>
#include <Events_Loop.h>
+#include <Config_PropManager.h>
#include <StdSelect_TypeOfFace.hxx>
#include <TopoDS_Vertex.hxx>
new ModuleBase_FilterCustom(aSelectFilter));
}
+void PartSet_Module::registerProperties()
+{
+ Config_PropManager::registerProp("Sketch planes", "planes_size", "Size", Config_Prop::Double,
+ PLANE_SIZE);
+ Config_PropManager::registerProp("Sketch planes", "planes_thickness", "Thickness",
+ Config_Prop::Integer, SKETCH_WIDTH);
+}
+
void PartSet_Module::operationCommitted(ModuleBase_Operation* theOperation)
{
if (theOperation->isEditOperation())
/// Register selection filters for this module
virtual void registerFilters();
+ /// Register properties of this module
+ virtual void registerProperties();
+
private slots:
/// Processing of vertex selected
void onVertexSelected();
#include <QTimer>
#include <QApplication>
-#define PLANE_SIZE "200"
-#define SKETCH_WIDTH "4"
PartSet_WidgetSketchLabel::PartSet_WidgetSketchLabel(QWidget* theParent,
std::shared_ptr<GeomAPI_Dir> theNorm,
const int theRGB[3])
{
- double aSize = Config_PropManager::integer("Sketch planes", "Size of planes", PLANE_SIZE);
+ double aSize = Config_PropManager::integer("Sketch planes", "planes_size", PLANE_SIZE);
std::shared_ptr<GeomAPI_Shape> aFace = GeomAlgoAPI_FaceBuilder::square(theOrigin, theNorm, aSize);
AISObjectPtr aAIS = AISObjectPtr(new GeomAPI_AISObject());
aAIS->createShape(aFace);
class XGUI_OperationMgr;
class XGUI_Workshop;
+/// the plane edge width
+#define SKETCH_WIDTH "4"
+
+/// face of the square-face displayed for selection of general plane
+#define PLANE_SIZE "200"
+
/**
* \ingroup Modules
* A model widget implementation for a label which provides specific behaviour
if (!aConst)
return thePrevious;
+
+ std::shared_ptr<SketchPlugin_Feature> aSketchFea =
+ std::dynamic_pointer_cast<SketchPlugin_Feature>(ModelAPI_Feature::feature(aConst));
+ if (aSketchFea.get() != NULL) {
+ if (aSketchFea->isExternal())
+ return thePrevious;
+ }
aShape = aConst->shape();
}
else {
{
AttributeSelectionPtr aAttr = data()->selection(EXTERNAL_ID());
if (aAttr)
- return aAttr->context().get() == NULL;
+ return aAttr->context().get() != NULL;
return false;
}
virtual void customisePresentation(AISObjectPtr thePrs)
{
// if this is an edge
- if (thePrs->getShapeType() == 6)
+ if (thePrs->getShapeType() == 6) {
thePrs->setWidth(3);
+ if (isExternal())
+ thePrs->setColor(0,255,0);
+ }
// if this is a vertex
//else if (thePrs->getShapeType() == 7)
// thePrs->setPointMarker(6, 2.);
ModelAPI_Session::get()->registerPlugin(this);
// register sketcher properties
- Config_PropManager::registerProp("Sketch planes", "planes_color", "Color", Config_Prop::Color,
- SKETCH_PLANE_COLOR);
- Config_PropManager::registerProp("Sketch planes", "planes_size", "Size", Config_Prop::Double,
- PLANE_SIZE);
- Config_PropManager::registerProp("Sketch planes", "planes_thickness", "Thickness",
- Config_Prop::Integer, SKETCH_WIDTH);
Config_PropManager::registerProp("Visualization", "parallel_color", "Parallel constraint color",
Config_Prop::Color, PARALLEL_COLOR);
#include <GeomAPI_IPresentable.h>
#include <list>
-/// the plane edge color
-#define SKETCH_PLANE_COLOR "#700000"
-
-/// the plane edge width
-#define SKETCH_WIDTH "4"
-
-/// face of the square-face displayed for selection of general plane
-#define PLANE_SIZE "200"
-
/**\class SketchPlugin_Sketch
* \ingroup Plugins
* \brief Feature for creation of the new part in PartSet.