Add options for face detection and cut face edge display
This commit is contained in:
parent
62328bb54c
commit
ae5798434a
|
@ -817,28 +817,20 @@ void DrawViewPart::getRunControl()
|
||||||
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
|
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
|
||||||
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/RunControl");
|
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/RunControl");
|
||||||
m_interAlgo = hGrp->GetInt("InterAlgo", 2l);
|
m_interAlgo = hGrp->GetInt("InterAlgo", 2l);
|
||||||
m_sectionEdges = hGrp->GetInt("ShowSectionEdges", 1l);
|
m_sectionEdges = hGrp->GetBool("ShowSectionEdges", 1l);
|
||||||
m_handleFaces = hGrp->GetInt("HandleFaces", 1l);
|
m_handleFaces = hGrp->GetBool("HandleFaces", 1l);
|
||||||
// Base::Console().Message("TRACE - DVP::getRunControl - interAlgo: %ld sectionFaces: %ld handleFaces: %ld\n",
|
// Base::Console().Message("TRACE - DVP::getRunControl - interAlgo: %ld sectionFaces: %ld handleFaces: %ld\n",
|
||||||
// m_interAlgo,m_sectionEdges,m_handleFaces);
|
// m_interAlgo,m_sectionEdges,m_handleFaces);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DrawViewPart::handleFaces(void)
|
bool DrawViewPart::handleFaces(void)
|
||||||
{
|
{
|
||||||
bool result = false;
|
return m_handleFaces;
|
||||||
if (m_handleFaces == 1l) {
|
|
||||||
result = true;
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DrawViewPart::showSectionEdges(void)
|
bool DrawViewPart::showSectionEdges(void)
|
||||||
{
|
{
|
||||||
bool result = false;
|
return m_sectionEdges;
|
||||||
if (m_sectionEdges == 1l) {
|
|
||||||
result = true;
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PyObject *DrawViewPart::getPyObject(void)
|
PyObject *DrawViewPart::getPyObject(void)
|
||||||
|
|
|
@ -156,8 +156,8 @@ protected:
|
||||||
void getRunControl(void);
|
void getRunControl(void);
|
||||||
|
|
||||||
long int m_interAlgo;
|
long int m_interAlgo;
|
||||||
long int m_sectionEdges;
|
bool m_sectionEdges;
|
||||||
long int m_handleFaces;
|
bool m_handleFaces;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static App::PropertyFloatConstraint::Constraints floatRange;
|
static App::PropertyFloatConstraint::Constraints floatRange;
|
||||||
|
|
|
@ -297,23 +297,25 @@ void QGIViewPart::drawViewPart()
|
||||||
removeDecorations();
|
removeDecorations();
|
||||||
|
|
||||||
#if MOD_TECHDRAW_HANDLE_FACES
|
#if MOD_TECHDRAW_HANDLE_FACES
|
||||||
// Draw Faces
|
if (viewPart->handleFaces()) {
|
||||||
std::vector<TechDraw::DrawHatch*> hatchObjs = viewPart->getHatches();
|
// Draw Faces
|
||||||
const std::vector<TechDrawGeometry::Face *> &faceGeoms = viewPart->getFaceGeometry();
|
std::vector<TechDraw::DrawHatch*> hatchObjs = viewPart->getHatches();
|
||||||
std::vector<TechDrawGeometry::Face *>::const_iterator fit = faceGeoms.begin();
|
const std::vector<TechDrawGeometry::Face *> &faceGeoms = viewPart->getFaceGeometry();
|
||||||
for(int i = 0 ; fit != faceGeoms.end(); fit++, i++) {
|
std::vector<TechDrawGeometry::Face *>::const_iterator fit = faceGeoms.begin();
|
||||||
QGIFace* newFace = drawFace(*fit,i);
|
for(int i = 0 ; fit != faceGeoms.end(); fit++, i++) {
|
||||||
TechDraw::DrawHatch* fHatch = faceIsHatched(i,hatchObjs);
|
QGIFace* newFace = drawFace(*fit,i);
|
||||||
if (fHatch) {
|
TechDraw::DrawHatch* fHatch = faceIsHatched(i,hatchObjs);
|
||||||
if (!fHatch->HatchPattern.isEmpty()) {
|
if (fHatch) {
|
||||||
App::Color hColor = fHatch->HatchColor.getValue();
|
if (!fHatch->HatchPattern.isEmpty()) {
|
||||||
newFace->setHatchColor(hColor.asCSSString());
|
App::Color hColor = fHatch->HatchColor.getValue();
|
||||||
newFace->setHatch(fHatch->HatchPattern.getValue());
|
newFace->setHatchColor(hColor.asCSSString());
|
||||||
|
newFace->setHatch(fHatch->HatchPattern.getValue());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
newFace->setDrawEdges(false);
|
||||||
|
newFace->setZValue(ZVALUE::FACE);
|
||||||
|
newFace->setPrettyNormal();
|
||||||
}
|
}
|
||||||
newFace->setDrawEdges(false);
|
|
||||||
newFace->setZValue(ZVALUE::FACE);
|
|
||||||
newFace->setPrettyNormal();
|
|
||||||
}
|
}
|
||||||
#endif //#if MOD_TECHDRAW_HANDLE_FACES
|
#endif //#if MOD_TECHDRAW_HANDLE_FACES
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,11 @@ void QGIViewSection::drawSectionFace()
|
||||||
QGIFace* newFace = drawFace(*fit,-1); //TODO: do we need to know which sectionFace this QGIFace came from?
|
QGIFace* newFace = drawFace(*fit,-1); //TODO: do we need to know which sectionFace this QGIFace came from?
|
||||||
newFace->setZValue(ZVALUE::SECTIONFACE);
|
newFace->setZValue(ZVALUE::SECTIONFACE);
|
||||||
newFace->setFill(faceColor, Qt::SolidPattern);
|
newFace->setFill(faceColor, Qt::SolidPattern);
|
||||||
newFace->setDrawEdges(false);
|
if (section->showSectionEdges()) {
|
||||||
|
newFace->setDrawEdges(true);
|
||||||
|
} else {
|
||||||
|
newFace->setDrawEdges(false);
|
||||||
|
}
|
||||||
newFace->setPrettyNormal();
|
newFace->setPrettyNormal();
|
||||||
newFace->setAcceptHoverEvents(false);
|
newFace->setAcceptHoverEvents(false);
|
||||||
newFace->setFlag(QGraphicsItem::ItemIsSelectable, false);
|
newFace->setFlag(QGraphicsItem::ItemIsSelectable, false);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user