fix naming conflicts
This commit is contained in:
@@ -48,7 +48,7 @@
|
||||
#include "ViewProviderSymbol.h"
|
||||
#include "ViewProviderViewClip.h"
|
||||
#include "ViewProviderHatch.h"
|
||||
#include "ViewProviderCrosshatch.h"
|
||||
#include "ViewProviderGeomHatch.h"
|
||||
#include "ViewProviderSpreadsheet.h"
|
||||
#include "ViewProviderImage.h"
|
||||
|
||||
@@ -103,7 +103,7 @@ void TechDrawGuiExport initTechDrawGui()
|
||||
TechDrawGui::ViewProviderDraft::init();
|
||||
TechDrawGui::ViewProviderArch::init();
|
||||
TechDrawGui::ViewProviderHatch::init();
|
||||
TechDrawGui::ViewProviderCrosshatch::init();
|
||||
TechDrawGui::ViewProviderGeomHatch::init();
|
||||
TechDrawGui::ViewProviderSpreadsheet::init();
|
||||
TechDrawGui::ViewProviderImage::init();
|
||||
|
||||
|
||||
@@ -199,8 +199,8 @@ SET(TechDrawGuiViewProvider_SRCS
|
||||
ViewProviderViewClip.h
|
||||
ViewProviderHatch.cpp
|
||||
ViewProviderHatch.h
|
||||
ViewProviderCrosshatch.cpp
|
||||
ViewProviderCrosshatch.h
|
||||
ViewProviderGeomHatch.cpp
|
||||
ViewProviderGeomHatch.h
|
||||
ViewProviderImage.cpp
|
||||
ViewProviderImage.h
|
||||
)
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
#include <Mod/TechDraw/App/DrawView.h>
|
||||
#include <Mod/TechDraw/App/DrawViewPart.h>
|
||||
#include <Mod/TechDraw/App/DrawHatch.h>
|
||||
#include <Mod/TechDraw/App/DrawCrosshatch.h>
|
||||
#include <Mod/TechDraw/App/DrawGeomHatch.h>
|
||||
#include <Mod/TechDraw/App/DrawPage.h>
|
||||
#include <Mod/TechDraw/App/DrawUtil.h>
|
||||
#include <Mod/TechDraw/Gui/QGVPage.h>
|
||||
@@ -128,24 +128,24 @@ bool CmdTechDrawNewHatch::isActive(void)
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
// TechDraw_NewCrosshatch
|
||||
// TechDraw_NewGeomHatch
|
||||
//===========================================================================
|
||||
|
||||
DEF_STD_CMD_A(CmdTechDrawNewCrosshatch);
|
||||
DEF_STD_CMD_A(CmdTechDrawNewGeomHatch);
|
||||
|
||||
CmdTechDrawNewCrosshatch::CmdTechDrawNewCrosshatch()
|
||||
: Command("TechDraw_NewCrosshatch")
|
||||
CmdTechDrawNewGeomHatch::CmdTechDrawNewGeomHatch()
|
||||
: Command("TechDraw_NewGeomHatch")
|
||||
{
|
||||
sAppModule = "TechDraw";
|
||||
sGroup = QT_TR_NOOP("TechDraw");
|
||||
sMenuText = QT_TR_NOOP("Apply geometric hatch to a Face");
|
||||
sToolTipText = QT_TR_NOOP("Apply geometric hatch to a Face");
|
||||
sWhatsThis = "TechDraw_NewCrosshatch";
|
||||
sWhatsThis = "TechDraw_NewGeomHatch";
|
||||
sStatusTip = sToolTipText;
|
||||
sPixmap = "actions/techdraw-crosshatch";
|
||||
sPixmap = "actions/techdraw-geomhatch";
|
||||
}
|
||||
|
||||
void CmdTechDrawNewCrosshatch::activated(int iMsg)
|
||||
void CmdTechDrawNewGeomHatch::activated(int iMsg)
|
||||
{
|
||||
Q_UNUSED(iMsg);
|
||||
if (!_checkSelectionHatch(this)) { //same requirements as hatch - page, DrawViewXXX, face
|
||||
@@ -161,16 +161,16 @@ void CmdTechDrawNewCrosshatch::activated(int iMsg)
|
||||
TechDraw::DrawPage* page = objFeat->findParentPage();
|
||||
std::string PageName = page->getNameInDocument();
|
||||
|
||||
std::string FeatName = getUniqueObjectName("Crosshatch");
|
||||
std::string FeatName = getUniqueObjectName("GeomHatch");
|
||||
std::stringstream featLabel;
|
||||
featLabel << FeatName << "FX" << TechDraw::DrawUtil::getIndexFromName(subNames.at(0));
|
||||
|
||||
openCommand("Create Crosshatch");
|
||||
doCommand(Doc,"App.activeDocument().addObject('TechDraw::DrawCrosshatch','%s')",FeatName.c_str());
|
||||
openCommand("Create GeomHatch");
|
||||
doCommand(Doc,"App.activeDocument().addObject('TechDraw::DrawGeomHatch','%s')",FeatName.c_str());
|
||||
doCommand(Doc,"App.activeDocument().%s.Label = '%s'",FeatName.c_str(),featLabel.str().c_str());
|
||||
|
||||
auto crosshatch( static_cast<TechDraw::DrawCrosshatch *>(getDocument()->getObject(FeatName.c_str())) );
|
||||
crosshatch->Source.setValue(objFeat, subNames);
|
||||
auto geomhatch( static_cast<TechDraw::DrawGeomHatch *>(getDocument()->getObject(FeatName.c_str())) );
|
||||
geomhatch->Source.setValue(objFeat, subNames);
|
||||
|
||||
commitCommand();
|
||||
|
||||
@@ -180,7 +180,7 @@ void CmdTechDrawNewCrosshatch::activated(int iMsg)
|
||||
getDocument()->recompute();
|
||||
}
|
||||
|
||||
bool CmdTechDrawNewCrosshatch::isActive(void)
|
||||
bool CmdTechDrawNewGeomHatch::isActive(void)
|
||||
{
|
||||
bool havePage = DrawGuiUtil::needPage(this);
|
||||
bool haveView = DrawGuiUtil::needView(this);
|
||||
@@ -291,7 +291,7 @@ void CreateTechDrawCommandsDecorate(void)
|
||||
Gui::CommandManager &rcCmdMgr = Gui::Application::Instance->commandManager();
|
||||
|
||||
rcCmdMgr.addCommand(new CmdTechDrawNewHatch());
|
||||
rcCmdMgr.addCommand(new CmdTechDrawNewCrosshatch());
|
||||
rcCmdMgr.addCommand(new CmdTechDrawNewGeomHatch());
|
||||
rcCmdMgr.addCommand(new CmdTechDrawImage());
|
||||
rcCmdMgr.addCommand(new CmdTechDrawToggleFrame());
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ QGIFace::QGIFace(int index) :
|
||||
m_styleNormal = m_styleDef;
|
||||
m_fillStyle = m_styleDef;
|
||||
m_colNormalFill = m_colDefFill;
|
||||
m_crossColor = QColor(Qt::black);
|
||||
m_geomColor = QColor(Qt::black);
|
||||
setLineWeight(0.5); //0 = cosmetic
|
||||
|
||||
setPrettyNormal();
|
||||
@@ -99,17 +99,17 @@ void QGIFace::draw()
|
||||
setPath(m_outline); //Face boundary
|
||||
|
||||
if (isHatched()) {
|
||||
if (m_mode == CrosshatchFill) { //crosshatch
|
||||
if (!m_crossHatchPaths.empty()) { //surrogate for LineSets.empty
|
||||
if (m_mode == GeomHatchFill) { //crosshatch
|
||||
if (!m_geomHatchPaths.empty()) { //surrogate for LineSets.empty
|
||||
m_brush.setTexture(nullptr);
|
||||
m_fillStyle = m_styleDef;
|
||||
m_styleNormal = m_fillStyle;
|
||||
int pathNo = 0;
|
||||
for (auto& pp: m_crossHatchPaths) {
|
||||
for (auto& pp: m_geomHatchPaths) {
|
||||
QGraphicsPathItem* fillItem = m_fillItems.at(pathNo);
|
||||
fillItem->setPath(pp);
|
||||
QPen crossPen = setCrossPen(pathNo);
|
||||
fillItem->setPen(crossPen);
|
||||
QPen geomPen = setGeomPen(pathNo);
|
||||
fillItem->setPen(geomPen);
|
||||
pathNo++;
|
||||
}
|
||||
}
|
||||
@@ -217,7 +217,7 @@ void QGIFace::setOutline(const QPainterPath & path)
|
||||
|
||||
void QGIFace::clearLineSets(void)
|
||||
{
|
||||
m_crossHatchPaths.clear();
|
||||
m_geomHatchPaths.clear();
|
||||
m_dashSpecs.clear();
|
||||
clearFillItems();
|
||||
}
|
||||
@@ -225,7 +225,7 @@ void QGIFace::clearLineSets(void)
|
||||
//each line set needs a painterpath, a dashspec and a QGPItem to show them
|
||||
void QGIFace::addLineSet(QPainterPath pp, std::vector<double> dp)
|
||||
{
|
||||
m_crossHatchPaths.push_back(pp);
|
||||
m_geomHatchPaths.push_back(pp);
|
||||
m_dashSpecs.push_back(DashSpec(dp));
|
||||
addFillItem();
|
||||
}
|
||||
@@ -253,7 +253,7 @@ QVector<qreal> QGIFace::decodeDashSpec(DashSpec patDash)
|
||||
//Rez::guiX(something)?
|
||||
double dotLength = 3.0;
|
||||
double unitLength = 6.0;
|
||||
// double penWidth = m_crossWeight; //mark, space and dot lengths are to be in terms of penWidth(Qt) or mm(PAT)??
|
||||
// double penWidth = m_geomWeight; //mark, space and dot lengths are to be in terms of penWidth(Qt) or mm(PAT)??
|
||||
// //if we want it in terms of mm, we need to divide by penWidth?
|
||||
// double minPen = 0.01; //avoid trouble with cosmetic pen (zero width)
|
||||
std::vector<double> result;
|
||||
@@ -273,16 +273,15 @@ QVector<qreal> QGIFace::decodeDashSpec(DashSpec patDash)
|
||||
}
|
||||
|
||||
|
||||
QPen QGIFace::setCrossPen(int i)
|
||||
QPen QGIFace::setGeomPen(int i)
|
||||
{
|
||||
//m_dashSpecs[i].dump("spec test");
|
||||
DashSpec ourSpec = m_dashSpecs.at(i);
|
||||
//ourSpec.dump("our spec");
|
||||
|
||||
QPen result;
|
||||
result.setWidthF(Rez::guiX(m_crossWeight)); //Rez::guiX() ?? line weights are in mm?
|
||||
// result.setWidthF(Rez::guiX(0.09));
|
||||
result.setColor(m_crossColor);
|
||||
result.setWidthF(Rez::guiX(m_geomWeight)); //Rez::guiX() ?? line weights are in mm?
|
||||
result.setColor(m_geomColor);
|
||||
if (ourSpec.empty()) {
|
||||
result.setStyle(Qt::SolidLine);
|
||||
} else {
|
||||
@@ -348,7 +347,7 @@ QPixmap QGIFace::textureFromSvg(std::string fileSpec)
|
||||
void QGIFace::setHatchColor(App::Color c)
|
||||
{
|
||||
m_svgCol = c.asCSSString();
|
||||
m_crossColor = c.asValue<QColor>();
|
||||
m_geomColor = c.asValue<QColor>();
|
||||
}
|
||||
|
||||
void QGIFace::setHatchScale(double s)
|
||||
@@ -396,7 +395,7 @@ void QGIFace::resetFill() {
|
||||
}
|
||||
|
||||
void QGIFace::setLineWeight(double w) {
|
||||
m_crossWeight = w;
|
||||
m_geomWeight = w;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ public:
|
||||
FromFile,
|
||||
SvgFill,
|
||||
BitmapFill,
|
||||
CrosshatchFill,
|
||||
GeomHatchFill,
|
||||
PlainFill
|
||||
};
|
||||
|
||||
@@ -100,7 +100,7 @@ public:
|
||||
void clearSvg(void);
|
||||
|
||||
//PAT fill parms & methods
|
||||
void setCrosshatchWeight(double w) { m_crossWeight = w; }
|
||||
void setGeomHatchWeight(double w) { m_geomWeight = w; }
|
||||
void clearLineSets(void);
|
||||
void addLineSet(QPainterPath pp, std::vector<double> dp);
|
||||
QGraphicsPathItem* addFillItem();
|
||||
@@ -124,10 +124,10 @@ protected:
|
||||
bool m_isHatched;
|
||||
QGIFace::fillMode m_mode;
|
||||
|
||||
QPen setCrossPen(int i);
|
||||
QPen setGeomPen(int i);
|
||||
QVector<qreal> decodeDashSpec(DashSpec d);
|
||||
std::vector<QGraphicsPathItem*> m_fillItems;
|
||||
std::vector<QPainterPath> m_crossHatchPaths; // 0/1 dashspec per crosshatchpath
|
||||
std::vector<QPainterPath> m_geomHatchPaths; // 0/1 dashspec per hatchpath
|
||||
std::vector<DashSpec> m_dashSpecs;
|
||||
|
||||
|
||||
@@ -146,10 +146,10 @@ private:
|
||||
|
||||
QPainterPath m_outline; //
|
||||
|
||||
QPainterPath m_crosshatch; //crosshatch fill lines
|
||||
QPainterPath m_geomhatch; //crosshatch fill lines
|
||||
|
||||
QColor m_crossColor; //color for crosshatch lines
|
||||
double m_crossWeight; //lineweight for crosshatch lines
|
||||
QColor m_geomColor; //color for crosshatch lines
|
||||
double m_geomWeight; //lineweight for crosshatch lines
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
#include <Mod/TechDraw/App/DrawViewPart.h>
|
||||
#include <Mod/TechDraw/App/DrawViewSection.h>
|
||||
#include <Mod/TechDraw/App/DrawHatch.h>
|
||||
#include <Mod/TechDraw/App/DrawCrosshatch.h>
|
||||
#include <Mod/TechDraw/App/DrawGeomHatch.h>
|
||||
#include <Mod/TechDraw/App/DrawViewDetail.h>
|
||||
|
||||
#include "Rez.h"
|
||||
@@ -68,7 +68,7 @@
|
||||
#include "QGCustomRect.h"
|
||||
#include "QGIMatting.h"
|
||||
#include "QGIViewPart.h"
|
||||
#include "ViewProviderCrosshatch.h"
|
||||
#include "ViewProviderGeomHatch.h"
|
||||
|
||||
using namespace TechDrawGui;
|
||||
using namespace TechDrawGeometry;
|
||||
@@ -378,7 +378,7 @@ void QGIViewPart::drawViewPart()
|
||||
if (viewPart->handleFaces()) {
|
||||
// Draw Faces
|
||||
std::vector<TechDraw::DrawHatch*> hatchObjs = viewPart->getHatches();
|
||||
std::vector<TechDraw::DrawCrosshatch*> crossObjs = viewPart->getCrosshatches();
|
||||
std::vector<TechDraw::DrawGeomHatch*> geomObjs = viewPart->getGeomHatches();
|
||||
const std::vector<TechDrawGeometry::Face *> &faceGeoms = viewPart->getFaceGeometry();
|
||||
std::vector<TechDrawGeometry::Face *>::const_iterator fit = faceGeoms.begin();
|
||||
for(int i = 0 ; fit != faceGeoms.end(); fit++, i++) {
|
||||
@@ -386,12 +386,12 @@ void QGIViewPart::drawViewPart()
|
||||
newFace->isHatched(false);
|
||||
newFace->setFillMode(QGIFace::PlainFill);
|
||||
TechDraw::DrawHatch* fHatch = faceIsHatched(i,hatchObjs);
|
||||
TechDraw::DrawCrosshatch* fCross = faceIsCrosshatched(i,crossObjs);
|
||||
if (fCross) {
|
||||
const std::vector<std::string> &sourceNames = fCross->Source.getSubValues();
|
||||
TechDraw::DrawGeomHatch* fGeom = faceIsGeomHatched(i,geomObjs);
|
||||
if (fGeom) {
|
||||
const std::vector<std::string> &sourceNames = fGeom->Source.getSubValues();
|
||||
if (!sourceNames.empty()) {
|
||||
int fdx = TechDraw::DrawUtil::getIndexFromName(sourceNames.at(0));
|
||||
std::vector<LineSet> lineSets = fCross->getDrawableLines(fdx);
|
||||
std::vector<LineSet> lineSets = fGeom->getDrawableLines(fdx);
|
||||
if (!lineSets.empty()) {
|
||||
newFace->clearLineSets();
|
||||
for (auto& ls: lineSets) {
|
||||
@@ -403,14 +403,14 @@ void QGIViewPart::drawViewPart()
|
||||
newFace->addLineSet(bigPath,ls.getDashSpec());
|
||||
}
|
||||
newFace->isHatched(true);
|
||||
newFace->setFillMode(QGIFace::CrosshatchFill);
|
||||
newFace->setHatchScale(fCross->ScalePattern.getValue());
|
||||
newFace->setHatchFile(fCross->FilePattern.getValue());
|
||||
Gui::ViewProvider* gvp = QGIView::getViewProvider(fCross);
|
||||
ViewProviderCrosshatch* crossVp = dynamic_cast<ViewProviderCrosshatch*>(gvp);
|
||||
if (crossVp != nullptr) {
|
||||
newFace->setHatchColor(crossVp->ColorPattern.getValue());
|
||||
newFace->setLineWeight(crossVp->WeightPattern.getValue());
|
||||
newFace->setFillMode(QGIFace::GeomHatchFill);
|
||||
newFace->setHatchScale(fGeom->ScalePattern.getValue());
|
||||
newFace->setHatchFile(fGeom->FilePattern.getValue());
|
||||
Gui::ViewProvider* gvp = QGIView::getViewProvider(fGeom);
|
||||
ViewProviderGeomHatch* geomVp = dynamic_cast<ViewProviderGeomHatch*>(gvp);
|
||||
if (geomVp != nullptr) {
|
||||
newFace->setHatchColor(geomVp->ColorPattern.getValue());
|
||||
newFace->setLineWeight(geomVp->WeightPattern.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -887,10 +887,10 @@ TechDraw::DrawHatch* QGIViewPart::faceIsHatched(int i,std::vector<TechDraw::Draw
|
||||
return result;
|
||||
}
|
||||
|
||||
TechDraw::DrawCrosshatch* QGIViewPart::faceIsCrosshatched(int i,std::vector<TechDraw::DrawCrosshatch*> crossObjs) const
|
||||
TechDraw::DrawGeomHatch* QGIViewPart::faceIsGeomHatched(int i,std::vector<TechDraw::DrawGeomHatch*> geomObjs) const
|
||||
{
|
||||
TechDraw::DrawCrosshatch* result = nullptr;
|
||||
for (auto& h:crossObjs) {
|
||||
TechDraw::DrawGeomHatch* result = nullptr;
|
||||
for (auto& h:geomObjs) {
|
||||
const std::vector<std::string> &sourceNames = h->Source.getSubValues();
|
||||
int fdx = TechDraw::DrawUtil::getIndexFromName(sourceNames.at(0));
|
||||
if (fdx == i) {
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace TechDraw {
|
||||
class DrawViewPart;
|
||||
class DrawViewSection;
|
||||
class DrawHatch;
|
||||
class DrawCrosshatch;
|
||||
class DrawGeomHatch;
|
||||
}
|
||||
|
||||
namespace TechDrawGui
|
||||
@@ -90,7 +90,7 @@ protected:
|
||||
virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value) override;
|
||||
|
||||
TechDraw::DrawHatch* faceIsHatched(int i,std::vector<TechDraw::DrawHatch*> hatchObjs) const;
|
||||
TechDraw::DrawCrosshatch* faceIsCrosshatched(int i,std::vector<TechDraw::DrawCrosshatch*> crossObjs) const;
|
||||
TechDraw::DrawGeomHatch* faceIsGeomHatched(int i,std::vector<TechDraw::DrawGeomHatch*> geomObjs) const;
|
||||
void dumpPath(const char* text,QPainterPath path);
|
||||
void removePrimitives(void);
|
||||
void removeDecorations(void);
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
#include <Base/Console.h>
|
||||
#include <App/Material.h>
|
||||
|
||||
#include <Mod/TechDraw/App/DrawCrosshatch.h>
|
||||
#include <Mod/TechDraw/App/DrawGeomHatch.h>
|
||||
#include <Mod/TechDraw/App/DrawViewSection.h>
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ void QGIViewSection::drawSectionFace()
|
||||
QString ext = hfi.suffix();
|
||||
if ((ext.toUpper() == QString::fromUtf8("PAT")) &&
|
||||
!patternName.empty() ) {
|
||||
newFace->setFillMode(QGIFace::CrosshatchFill);
|
||||
newFace->setFillMode(QGIFace::GeomHatchFill);
|
||||
newFace->setLineWeight(sectionVp->WeightPattern.getValue());
|
||||
std::vector<LineSet> lineSets = section->getDrawableLines(i);
|
||||
if (!lineSets.empty()) {
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
<file>icons/actions/techdraw-saveSVG.svg</file>
|
||||
<file>icons/actions/techdraw-viewsection.svg</file>
|
||||
<file>icons/actions/techdraw-hatch.svg</file>
|
||||
<file>icons/actions/techdraw-crosshatch.svg</file>
|
||||
<file>icons/actions/techdraw-geomhatch.svg</file>
|
||||
<file>icons/actions/techdraw-toggleframe.svg</file>
|
||||
<file>icons/actions/techdraw-projgroup.svg</file>
|
||||
<file>icons/actions/techdraw-spreadsheet.svg</file>
|
||||
|
||||
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
@@ -49,48 +49,48 @@
|
||||
#include <Gui/Utilities.h>
|
||||
#include <Gui/Control.h>
|
||||
|
||||
#include <Mod/TechDraw/App/DrawCrosshatch.h>
|
||||
#include <Mod/TechDraw/App/DrawGeomHatch.h>
|
||||
#include <Mod/TechDraw/App/DrawViewPart.h>
|
||||
#include <Mod/TechDraw/App/DrawView.h>
|
||||
#include "ViewProviderDrawingView.h"
|
||||
#include "ViewProviderCrosshatch.h"
|
||||
#include "ViewProviderGeomHatch.h"
|
||||
|
||||
using namespace TechDrawGui;
|
||||
|
||||
PROPERTY_SOURCE(TechDrawGui::ViewProviderCrosshatch, Gui::ViewProviderDocumentObject)
|
||||
PROPERTY_SOURCE(TechDrawGui::ViewProviderGeomHatch, Gui::ViewProviderDocumentObject)
|
||||
|
||||
//**************************************************************************
|
||||
// Construction/Destruction
|
||||
|
||||
ViewProviderCrosshatch::ViewProviderCrosshatch()
|
||||
ViewProviderGeomHatch::ViewProviderGeomHatch()
|
||||
{
|
||||
static const char *vgroup = "Format";
|
||||
|
||||
sPixmap = "actions/techdraw-crosshatch";
|
||||
sPixmap = "actions/techdraw-geomhatch";
|
||||
|
||||
ADD_PROPERTY_TYPE(ColorPattern,(0),vgroup,App::Prop_None,"The color of the pattern");
|
||||
ADD_PROPERTY_TYPE(WeightPattern,(0.1),vgroup,App::Prop_None,"Crosshatch pattern line thickness");
|
||||
ADD_PROPERTY_TYPE(WeightPattern,(0.1),vgroup,App::Prop_None,"GeomHatch pattern line thickness");
|
||||
|
||||
getParameters();
|
||||
|
||||
}
|
||||
|
||||
ViewProviderCrosshatch::~ViewProviderCrosshatch()
|
||||
ViewProviderGeomHatch::~ViewProviderGeomHatch()
|
||||
{
|
||||
}
|
||||
|
||||
void ViewProviderCrosshatch::attach(App::DocumentObject *pcFeat)
|
||||
void ViewProviderGeomHatch::attach(App::DocumentObject *pcFeat)
|
||||
{
|
||||
// call parent attach method
|
||||
ViewProviderDocumentObject::attach(pcFeat);
|
||||
}
|
||||
|
||||
void ViewProviderCrosshatch::setDisplayMode(const char* ModeName)
|
||||
void ViewProviderGeomHatch::setDisplayMode(const char* ModeName)
|
||||
{
|
||||
ViewProviderDocumentObject::setDisplayMode(ModeName);
|
||||
}
|
||||
|
||||
std::vector<std::string> ViewProviderCrosshatch::getDisplayModes(void) const
|
||||
std::vector<std::string> ViewProviderGeomHatch::getDisplayModes(void) const
|
||||
{
|
||||
// get the modes of the father
|
||||
std::vector<std::string> StrList = ViewProviderDocumentObject::getDisplayModes();
|
||||
@@ -99,7 +99,7 @@ std::vector<std::string> ViewProviderCrosshatch::getDisplayModes(void) const
|
||||
}
|
||||
|
||||
//for VP properties
|
||||
void ViewProviderCrosshatch::onChanged(const App::Property* prop)
|
||||
void ViewProviderGeomHatch::onChanged(const App::Property* prop)
|
||||
{
|
||||
if (prop == &WeightPattern ||
|
||||
prop == &ColorPattern ) {
|
||||
@@ -110,7 +110,7 @@ void ViewProviderCrosshatch::onChanged(const App::Property* prop)
|
||||
}
|
||||
|
||||
//for feature properties
|
||||
void ViewProviderCrosshatch::updateData(const App::Property* prop)
|
||||
void ViewProviderGeomHatch::updateData(const App::Property* prop)
|
||||
{
|
||||
if (prop == &(getViewObject()->ScalePattern)) {
|
||||
updateGraphic();
|
||||
@@ -118,9 +118,9 @@ void ViewProviderCrosshatch::updateData(const App::Property* prop)
|
||||
Gui::ViewProviderDocumentObject::updateData(prop);
|
||||
}
|
||||
|
||||
void ViewProviderCrosshatch::updateGraphic(void)
|
||||
void ViewProviderGeomHatch::updateGraphic(void)
|
||||
{
|
||||
TechDraw::DrawCrosshatch* dc = getViewObject();
|
||||
TechDraw::DrawGeomHatch* dc = getViewObject();
|
||||
if (dc) {
|
||||
TechDraw::DrawViewPart* dvp = dc->getSourceView();
|
||||
if (dvp) {
|
||||
@@ -138,12 +138,12 @@ void ViewProviderCrosshatch::updateGraphic(void)
|
||||
}
|
||||
|
||||
|
||||
void ViewProviderCrosshatch::getParameters(void)
|
||||
void ViewProviderGeomHatch::getParameters(void)
|
||||
{
|
||||
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
|
||||
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Colors");
|
||||
App::Color fcColor;
|
||||
fcColor.setPackedValue(hGrp->GetUnsigned("Crosshatch", 0x00000000));
|
||||
fcColor.setPackedValue(hGrp->GetUnsigned("GeomHatch", 0x00000000));
|
||||
ColorPattern.setValue(fcColor);
|
||||
|
||||
hGrp = App::GetApplication().GetUserParameter()
|
||||
@@ -152,7 +152,7 @@ void ViewProviderCrosshatch::getParameters(void)
|
||||
WeightPattern.setValue(lineWeight);
|
||||
}
|
||||
|
||||
TechDraw::DrawCrosshatch* ViewProviderCrosshatch::getViewObject() const
|
||||
TechDraw::DrawGeomHatch* ViewProviderGeomHatch::getViewObject() const
|
||||
{
|
||||
return dynamic_cast<TechDraw::DrawCrosshatch*>(pcObject);
|
||||
return dynamic_cast<TechDraw::DrawGeomHatch*>(pcObject);
|
||||
}
|
||||
@@ -33,21 +33,21 @@
|
||||
|
||||
|
||||
namespace TechDraw{
|
||||
class DrawCrosshatch;
|
||||
class DrawGeomHatch;
|
||||
}
|
||||
|
||||
namespace TechDrawGui {
|
||||
|
||||
|
||||
class TechDrawGuiExport ViewProviderCrosshatch : public Gui::ViewProviderDocumentObject
|
||||
class TechDrawGuiExport ViewProviderGeomHatch : public Gui::ViewProviderDocumentObject
|
||||
{
|
||||
PROPERTY_HEADER(TechDrawGui::ViewProviderCrosshatch);
|
||||
PROPERTY_HEADER(TechDrawGui::ViewProviderGeomHatch);
|
||||
|
||||
public:
|
||||
/// constructor
|
||||
ViewProviderCrosshatch();
|
||||
ViewProviderGeomHatch();
|
||||
/// destructor
|
||||
virtual ~ViewProviderCrosshatch();
|
||||
virtual ~ViewProviderGeomHatch();
|
||||
|
||||
App::PropertyFloat WeightPattern;
|
||||
App::PropertyColor ColorPattern;
|
||||
@@ -63,7 +63,7 @@ public:
|
||||
void updateGraphic(void);
|
||||
void getParameters(void);
|
||||
|
||||
TechDraw::DrawCrosshatch* getViewObject() const;
|
||||
TechDraw::DrawGeomHatch* getViewObject() const;
|
||||
};
|
||||
|
||||
} // namespace TechDrawGui
|
||||
@@ -39,7 +39,7 @@
|
||||
#include <Mod/TechDraw/App/DrawViewDimension.h>
|
||||
#include <Mod/TechDraw/App/DrawViewMulti.h>
|
||||
#include <Mod/TechDraw/App/DrawHatch.h>
|
||||
#include <Mod/TechDraw/App/DrawCrosshatch.h>
|
||||
#include <Mod/TechDraw/App/DrawGeomHatch.h>
|
||||
|
||||
#include<Mod/TechDraw/App/DrawPage.h>
|
||||
#include "ViewProviderViewPart.h"
|
||||
@@ -118,7 +118,7 @@ std::vector<App::DocumentObject*> ViewProviderViewPart::claimChildren(void) cons
|
||||
// valid children of a ViewPart are:
|
||||
// - Dimensions
|
||||
// - Hatches
|
||||
// - Crosshatches
|
||||
// - GeomHatches
|
||||
std::vector<App::DocumentObject*> temp;
|
||||
const std::vector<App::DocumentObject *> &views = getViewPart()->getInList();
|
||||
try {
|
||||
@@ -134,7 +134,7 @@ std::vector<App::DocumentObject*> ViewProviderViewPart::claimChildren(void) cons
|
||||
}
|
||||
} else if ((*it)->getTypeId().isDerivedFrom(TechDraw::DrawHatch::getClassTypeId())) {
|
||||
temp.push_back((*it));
|
||||
} else if ((*it)->getTypeId().isDerivedFrom(TechDraw::DrawCrosshatch::getClassTypeId())) {
|
||||
} else if ((*it)->getTypeId().isDerivedFrom(TechDraw::DrawGeomHatch::getClassTypeId())) {
|
||||
temp.push_back((*it));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ ViewProviderViewSection::ViewProviderViewSection()
|
||||
ADD_PROPERTY_TYPE(CutSurfaceColor,(0.0,0.0,0.0),sgroup,App::Prop_None,"The color to shade the cut surface");
|
||||
ADD_PROPERTY_TYPE(HatchCutSurface ,(false),hgroup,App::Prop_None,"Hatch the cut surface");
|
||||
ADD_PROPERTY_TYPE(HatchColor,(0.0,0.0,0.0),hgroup,App::Prop_None,"The color of the hatch pattern");
|
||||
ADD_PROPERTY_TYPE(WeightPattern,(0.1),hgroup,App::Prop_None,"Crosshatch pattern line thickness");
|
||||
ADD_PROPERTY_TYPE(WeightPattern,(0.1),hgroup,App::Prop_None,"GeomHatch pattern line thickness");
|
||||
|
||||
getParameters();
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ Gui::ToolBarItem* Workbench::setupToolBars() const
|
||||
Gui::ToolBarItem *decor = new Gui::ToolBarItem(root);
|
||||
decor->setCommand("TechDraw Decoration");
|
||||
*decor << "TechDraw_NewHatch";
|
||||
*decor << "TechDraw_NewCrosshatch";
|
||||
*decor << "TechDraw_NewGeomHatch";
|
||||
*decor << "TechDraw_Symbol";
|
||||
*decor << "TechDraw_Image";
|
||||
*decor << "TechDraw_ToggleFrame";
|
||||
@@ -176,7 +176,7 @@ Gui::ToolBarItem* Workbench::setupCommandBars() const
|
||||
Gui::ToolBarItem *decor = new Gui::ToolBarItem(root);
|
||||
decor->setCommand("TechDraw Decoration");
|
||||
*decor << "TechDraw_NewHatch";
|
||||
*decor << "TechDraw_NewCrosshatch";
|
||||
*decor << "TechDraw_NewGeomHatch";
|
||||
*decor << "TechDraw_Symbol";
|
||||
*decor << "TechDraw_Image";
|
||||
*decor << "TechDraw_ToggleFrame";
|
||||
|
||||
Reference in New Issue
Block a user