/// default color for a plane
inline static const std::string& DEFAULT_COLOR()
{
- static const std::string CONSTRUCTION_PLANE_COLOR("#32FF32");
+ static const std::string CONSTRUCTION_PLANE_COLOR("150,150,180");
return CONSTRUCTION_PLANE_COLOR;
}
new ExchangePlugin_ImportFormatValidator);
aFactory->registerValidator("ExchangePlugin_ExportFormat",
new ExchangePlugin_ExportFormatValidator);
-
- // register construction properties
- //Config_PropManager::registerProp("Visualization", "import_feature_color", "Imported feature color",
- // Config_Prop::Color, ExchangePlugin_ImportFeature::DEFAULT_COLOR());
}
FeaturePtr ExchangePlugin_Plugin::createFeature(string theFeatureID)
/// default color for a result body
inline static const std::string& DEFAULT_COLOR()
{
- static const std::string RESULT_BODY_COLOR("#E0A01B");
+ static const std::string RESULT_BODY_COLOR("150,150,180");
return RESULT_BODY_COLOR;
}
/// default color for a result construction
inline static const std::string& DEFAULT_COLOR()
{
- static const std::string RESULT_CONSTRUCTION_COLOR("#000000");
+ static const std::string RESULT_CONSTRUCTION_COLOR("120,120,120");
return RESULT_CONSTRUCTION_COLOR;
}
/// default color for a result body
inline static const std::string& DEFAULT_COLOR()
{
- static const std::string RESULT_GROUP_COLOR("#E0A01B");
+ static const std::string RESULT_GROUP_COLOR("150,150,180");
return RESULT_GROUP_COLOR;
}
/// Request for initialization of data model of the result: adding all attributes
myPreferences->setItemProperty("image_formats", aImgFiles, bgId);
//Config_PropManager::registerProp("Visualization", "object_default_color", "Object color",
- // Config_Prop::Color, "#ffffff");
+ // Config_Prop::Color, "225,225,225");
Config_PropManager::registerProp("Visualization", "result_body_color", "Body color",
Config_Prop::Color, Model_ResultBody::DEFAULT_COLOR());
* Also the list of possible attributes is provided to simplify assignment.
*/
-#define SKETCH_CONSTRAINT_COLOR "#ffff00"
-#define SKETCH_DIMENSION_COLOR "#ff00ff"
+#define SKETCH_CONSTRAINT_COLOR "225,225,0"
+#define SKETCH_DIMENSION_COLOR "64,128,225"
/** \class SketchPlugin_ConstraintBase
* \ingroup Plugins
#include <GeomAPI_Pnt.h>
#include <GeomAPI_Pln.h>
#include <GeomAPI_IPresentable.h>
+#include <GeomAPI_ICustomPrs.h>
+
#include <GeomAPI_Ax3.h>
#include <GeomAPI_XYZ.h>
#include <GeomDataAPI_Point.h>
#include <GeomDataAPI_Dir.h>
#include <list>
-#define YZ_PLANE_COLOR "#ff0000"
-#define XZ_PLANE_COLOR "#00ff00"
-#define XY_PLANE_COLOR "#0000ff"
+#define YZ_PLANE_COLOR "225,0,0"
+#define XZ_PLANE_COLOR "0,225,0"
+#define XY_PLANE_COLOR "0,0,225"
/**\class SketchPlugin_Sketch
* \ingroup Plugins
* \brief Feature for creation of the new part in PartSet.
*/
-class SketchPlugin_Sketch : public ModelAPI_CompositeFeature//, public GeomAPI_IPresentable
+class SketchPlugin_Sketch : public ModelAPI_CompositeFeature, public GeomAPI_ICustomPrs//, public GeomAPI_IPresentable
{
public:
/// Sketch feature kind
static void createPoint2DResult(ModelAPI_Feature* theFeature,
SketchPlugin_Sketch* theSketch,
const std::string& theAttributeID, const int theIndex);
+ /// Customize presentation of the feature
+ virtual bool customisePresentation(ResultPtr theResult, AISObjectPtr thePrs,
+ std::shared_ptr<GeomAPI_ICustomPrs> theDefaultPrs)
+ {
+ bool isCustomized = false;
+ // apply the color of the result to the presentation
+ if (theDefaultPrs.get())
+ isCustomized = theDefaultPrs->customisePresentation(theResult, thePrs, theDefaultPrs);
+ // set the sketch presentation bold
+ isCustomized = thePrs->setWidth(2) || isCustomized;
+
+ return isCustomized;
+ }
+
};
#endif
#include <Config_PropManager.h>
-#define SKETCH_ENTITY_COLOR "#ff0000"
-#define SKETCH_EXTERNAL_COLOR "#00ff00"
-#define SKETCH_AUXILIARY_COLOR "#000000"
+#define SKETCH_ENTITY_COLOR "225,0,0"
+#define SKETCH_EXTERNAL_COLOR "170,0,225"
+#define SKETCH_AUXILIARY_COLOR "0,85,0"
/**\class SketchPlugin_SketchEntity
* \ingroup Plugins