TechDraw: Add option to use polygonal HLR algorithm

Now on property panel there is option 'Coarse View' which allows to set
selected drawing view's Hidden Line Removal to utilize polygonal algorithm.
This should be faster on same cases (complex models).

When this option is set for a view there is known limitation with dimensions not
working on this experimental mode. At least currently this is best utilized on
view with no dimensions.

Also the vertices' 'black dots' are not drawn on this mode view to avoid
cluttering.  Face hilite is avoided, to gain speed. All curves are represented
by short linesegments in this mode.

Previously TechDraw always used OCC's exact HLR algorithm to generate views,
which produces good quality and continous shape lines but is sometimes
slower to generate than with polygonal approach.

Additionally now there is bool 'CoarseView' Parameter Editor setting, if anyone
wants to set this as their default.
This commit is contained in:
TeroK
2018-01-13 12:45:48 +02:00
committed by wmayer
parent e697f2ef50
commit 434bf4d3f3
6 changed files with 113 additions and 13 deletions

View File

@@ -125,7 +125,7 @@ DrawViewPart::DrawViewPart(void) : geometryObject(0)
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter().GetGroup("BaseApp")->
GetGroup("Preferences")->GetGroup("Mod/TechDraw/General");
double defDist = hGrp->GetFloat("FocusDistance",100.0);
bool coarseView = hGrp->GetBool("CoarseView", false);
//properties that affect Geometry
ADD_PROPERTY_TYPE(Source ,(0),group,App::Prop_None,"3D Shape to view");
@@ -135,6 +135,7 @@ DrawViewPart::DrawViewPart(void) : geometryObject(0)
ADD_PROPERTY_TYPE(Focus,(defDist),group,App::Prop_None,"Perspective view focus distance");
//properties that affect Appearance
ADD_PROPERTY_TYPE(CoarseView, (coarseView), sgroup, App::Prop_None, "Coarse View on/off");
//visible outline
ADD_PROPERTY_TYPE(SmoothVisible ,(false),sgroup,App::Prop_None,"Visible Smooth lines on/off");
ADD_PROPERTY_TYPE(SeamVisible ,(false),sgroup,App::Prop_None,"Visible Seam lines on/off");
@@ -278,7 +279,7 @@ App::DocumentObjectExecReturn *DrawViewPart::execute(void)
geometryObject = buildGeometryObject(mirroredShape,viewAxis);
#if MOD_TECHDRAW_HANDLE_FACES
if (handleFaces()) {
if (handleFaces() && !geometryObject->usePolygonHLR()) {
try {
extractFaces();
}
@@ -323,12 +324,19 @@ TechDrawGeometry::GeometryObject* DrawViewPart::buildGeometryObject(TopoDS_Shape
go->setIsoCount(IsoCount.getValue());
go->isPerspective(Perspective.getValue());
go->setFocus(Focus.getValue());
go->usePolygonHLR(CoarseView.getValue());
Base::Vector3d baseProjDir = Direction.getValue();
saveParamSpace(baseProjDir);
go->projectShape(shape,
viewAxis);
if (go->usePolygonHLR()){
go->projectShapeWithPolygonAlgo(shape,
viewAxis);
}
else{
go->projectShape(shape,
viewAxis);
}
go->extractGeometry(TechDrawGeometry::ecHARD, //always show the hard&outline visible lines
true);
go->extractGeometry(TechDrawGeometry::ecOUTLINE,