Drawing: Added property to set hidden line width - fixes #606
This commit is contained in:
parent
2bc15af126
commit
eab159b6ee
|
@ -84,7 +84,8 @@ FeatureViewPart::FeatureViewPart(void)
|
|||
ADD_PROPERTY_TYPE(Source ,(0),group,App::Prop_None,"Shape to view");
|
||||
ADD_PROPERTY_TYPE(ShowHiddenLines ,(false),group,App::Prop_None,"Control the appearance of the dashed hidden lines");
|
||||
ADD_PROPERTY_TYPE(ShowSmoothLines ,(false),group,App::Prop_None,"Control the appearance of the smooth lines");
|
||||
ADD_PROPERTY_TYPE(LineWidth,(0.35),vgroup,App::Prop_None,"The thickness of the resulting lines");
|
||||
ADD_PROPERTY_TYPE(LineWidth,(0.35),vgroup,App::Prop_None,"The thickness of the viewed lines");
|
||||
ADD_PROPERTY_TYPE(HiddenWidth,(0.15),vgroup,App::Prop_None,"The thickness of the hidden lines, if enabled");
|
||||
ADD_PROPERTY_TYPE(Tolerance,(0.05),vgroup,App::Prop_None,"The tessellation tolerance");
|
||||
Tolerance.setConstraints(&floatRange);
|
||||
}
|
||||
|
@ -202,7 +203,7 @@ App::DocumentObjectExecReturn *FeatureViewPart::execute(void)
|
|||
ProjectionAlgos::ExtractionType type = ProjectionAlgos::Plain;
|
||||
if (hidden) type = (ProjectionAlgos::ExtractionType)(type|ProjectionAlgos::WithHidden);
|
||||
if (smooth) type = (ProjectionAlgos::ExtractionType)(type|ProjectionAlgos::WithSmooth);
|
||||
result << Alg.getSVG(type, this->LineWidth.getValue() / this->Scale.getValue(), this->Tolerance.getValue());
|
||||
result << Alg.getSVG(type, this->LineWidth.getValue() / this->Scale.getValue(), this->Tolerance.getValue(), this->HiddenWidth.getValue() / this->Scale.getValue());
|
||||
|
||||
result << "</g>" << endl;
|
||||
|
||||
|
|
|
@ -53,6 +53,7 @@ public:
|
|||
App::PropertyBool ShowHiddenLines;
|
||||
App::PropertyBool ShowSmoothLines;
|
||||
App::PropertyFloat LineWidth;
|
||||
App::PropertyFloat HiddenWidth;
|
||||
App::PropertyFloatConstraint Tolerance;
|
||||
|
||||
|
||||
|
|
|
@ -146,14 +146,13 @@ void ProjectionAlgos::execute(void)
|
|||
|
||||
}
|
||||
|
||||
std::string ProjectionAlgos::getSVG(ExtractionType type, double scale, double tolerance)
|
||||
std::string ProjectionAlgos::getSVG(ExtractionType type, double scale, double tolerance, double hiddenscale)
|
||||
{
|
||||
std::stringstream result;
|
||||
SVGOutput output;
|
||||
float hfactor = 0.5f; // hidden line size factor, was 0.15f / 0.35f;
|
||||
|
||||
if (!H.IsNull() && (type & WithHidden)) {
|
||||
double width = hfactor * scale;
|
||||
double width = hiddenscale;
|
||||
BRepMesh::Mesh(H,tolerance);
|
||||
result << "<g"
|
||||
//<< " id=\"" << ViewName << "\"" << endl
|
||||
|
@ -168,7 +167,7 @@ std::string ProjectionAlgos::getSVG(ExtractionType type, double scale, double to
|
|||
<< "</g>" << endl;
|
||||
}
|
||||
if (!HO.IsNull() && (type & WithHidden)) {
|
||||
double width = hfactor * scale;
|
||||
double width = hiddenscale;
|
||||
BRepMesh::Mesh(HO,tolerance);
|
||||
result << "<g"
|
||||
//<< " id=\"" << ViewName << "\"" << endl
|
||||
|
@ -225,7 +224,7 @@ std::string ProjectionAlgos::getSVG(ExtractionType type, double scale, double to
|
|||
<< "</g>" << endl;
|
||||
}
|
||||
if (!H1.IsNull() && (type & WithSmooth) && (type & WithHidden)) {
|
||||
double width = hfactor * scale;
|
||||
double width = hiddenscale;
|
||||
BRepMesh::Mesh(H1,tolerance);
|
||||
result << "<g"
|
||||
//<< " id=\"" << ViewName << "\"" << endl
|
||||
|
@ -239,10 +238,6 @@ std::string ProjectionAlgos::getSVG(ExtractionType type, double scale, double to
|
|||
<< output.exportEdges(H1)
|
||||
<< "</g>" << endl;
|
||||
}
|
||||
/*result << "0" << endl
|
||||
<< "SECTION" << endl
|
||||
<< "2" << endl
|
||||
<< "ENTITIES" << endl;*/
|
||||
return result.str();
|
||||
}
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ public:
|
|||
WithSmooth = 2
|
||||
};
|
||||
|
||||
std::string getSVG(ExtractionType type, double scale, double tolerance);
|
||||
std::string getSVG(ExtractionType type, double scale=0.35, double tolerance=0.05, double hiddenscale=0.15);
|
||||
std::string getDXF(ExtractionType type, double scale, double tolerance);//added by Dan Falck 2011/09/25
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user