Part: grouped ViewProviderExt subdivided view properties

This commit is contained in:
carlopav
2020-06-21 23:26:14 +02:00
committed by wwmayer
parent a262b11cd7
commit 9b71dd77b6

View File

@@ -254,6 +254,8 @@ ViewProviderPartExt::ViewProviderPartExt()
lowerLimit = std::max(lowerLimit, Precision::Confusion());
tessRange.LowerBound = lowerLimit;
static const char *osgroup = "Object Style";
App::Material mat;
mat.ambientColor.set(0.2f,0.2f,0.2f);
mat.diffuseColor.set(r,g,b);
@@ -261,24 +263,30 @@ ViewProviderPartExt::ViewProviderPartExt()
mat.emissiveColor.set(0.0f,0.0f,0.0f);
mat.shininess = 1.0f;
mat.transparency = 0.0f;
ADD_PROPERTY(LineMaterial,(mat));
ADD_PROPERTY(PointMaterial,(mat));
ADD_PROPERTY(LineColor,(mat.diffuseColor));
ADD_PROPERTY(PointColor,(mat.diffuseColor));
ADD_PROPERTY(PointColorArray, (PointColor.getValue()));
ADD_PROPERTY(DiffuseColor,(ShapeColor.getValue()));
ADD_PROPERTY(LineColorArray,(LineColor.getValue()));
ADD_PROPERTY(LineWidth,(lwidth));
ADD_PROPERTY_TYPE(LineMaterial,(mat), osgroup, App::Prop_None, "Object line material.");
ADD_PROPERTY_TYPE(PointMaterial,(mat), osgroup, App::Prop_None, "Object point material.");
ADD_PROPERTY_TYPE(LineColor, (mat.diffuseColor), osgroup, App::Prop_None, "Set object line color.");
ADD_PROPERTY_TYPE(PointColor, (mat.diffuseColor), osgroup, App::Prop_None, "Set object point color");
ADD_PROPERTY_TYPE(PointColorArray, (PointColor.getValue()), osgroup, App::Prop_None, "Object point color array.");
ADD_PROPERTY_TYPE(DiffuseColor,(ShapeColor.getValue()), osgroup, App::Prop_None, "Object diffuse color.");
ADD_PROPERTY_TYPE(LineColorArray,(LineColor.getValue()), osgroup, App::Prop_None, "Object line color array.");
ADD_PROPERTY_TYPE(LineWidth,(lwidth), osgroup, App::Prop_None, "Set object line width.");
LineWidth.setConstraints(&sizeRange);
PointSize.setConstraints(&sizeRange);
ADD_PROPERTY(PointSize,(psize));
ADD_PROPERTY(Deviation,(0.5f));
ADD_PROPERTY_TYPE(PointSize,(psize), osgroup, App::Prop_None, "Set object point size.");
ADD_PROPERTY_TYPE(Deviation,(0.5f), osgroup, App::Prop_None,
"Sets the accuracy of the polygonal representation of the model\n"
"in the 3D view (tessellation). Lower values indicate better quality.\n"
"The value is in percent of object's size.");
Deviation.setConstraints(&tessRange);
ADD_PROPERTY(AngularDeflection,(28.65));
ADD_PROPERTY_TYPE(AngularDeflection,(28.65), osgroup, App::Prop_None,
"Specify how finely to generate the mesh for rendering on screen or when exporting.\n"
"The default value is 28.5 degrees, or 0.5 radians. The smaller the value\n"
"the smoother the appearance in the 3D view, and the finer the mesh that will be exported.");
AngularDeflection.setConstraints(&angDeflectionRange);
ADD_PROPERTY(Lighting,(twoside));
ADD_PROPERTY_TYPE(Lighting,(twoside), osgroup, App::Prop_None, "Set object lighting.");
Lighting.setEnums(LightingEnums);
ADD_PROPERTY(DrawStyle,((long int)0));
ADD_PROPERTY_TYPE(DrawStyle,((long int)0), osgroup, App::Prop_None, "Defines the style of the edges in the 3D view.");
DrawStyle.setEnums(DrawStyleEnums);
coords = new SoCoordinate3();