fix naming conflicts
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
#include "DrawViewSymbol.h"
|
||||
#include "DrawViewClip.h"
|
||||
#include "DrawHatch.h"
|
||||
#include "DrawCrosshatch.h"
|
||||
#include "DrawGeomHatch.h"
|
||||
#include "DrawViewDraft.h"
|
||||
#include "DrawViewArch.h"
|
||||
#include "DrawViewSpreadsheet.h"
|
||||
@@ -85,7 +85,7 @@ PyMODINIT_FUNC initTechDraw()
|
||||
|
||||
TechDraw::DrawViewClip ::init();
|
||||
TechDraw::DrawHatch ::init();
|
||||
TechDraw::DrawCrosshatch ::init();
|
||||
TechDraw::DrawGeomHatch ::init();
|
||||
TechDraw::DrawViewDraft ::init();
|
||||
TechDraw::DrawViewArch ::init();
|
||||
TechDraw::DrawViewImage ::init();
|
||||
|
||||
@@ -37,7 +37,7 @@ generate_from_xml(DrawViewSymbolPy)
|
||||
generate_from_xml(DrawViewClipPy)
|
||||
generate_from_xml(DrawViewDimensionPy)
|
||||
generate_from_xml(DrawHatchPy)
|
||||
generate_from_xml(DrawCrosshatchPy)
|
||||
generate_from_xml(DrawGeomHatchPy)
|
||||
generate_from_xml(DrawViewCollectionPy)
|
||||
generate_from_xml(DrawProjGroupPy)
|
||||
generate_from_xml(DrawProjGroupItemPy)
|
||||
@@ -75,8 +75,8 @@ SET(Draw_SRCS
|
||||
DrawViewSection.h
|
||||
DrawHatch.cpp
|
||||
DrawHatch.h
|
||||
DrawCrosshatch.cpp
|
||||
DrawCrosshatch.h
|
||||
DrawGeomHatch.cpp
|
||||
DrawGeomHatch.h
|
||||
DrawViewDraft.cpp
|
||||
DrawViewDraft.h
|
||||
DrawViewArch.cpp
|
||||
@@ -133,8 +133,8 @@ SET(Python_SRCS
|
||||
DrawViewDimensionPyImp.cpp
|
||||
DrawHatchPy.xml
|
||||
DrawHatchPyImp.cpp
|
||||
DrawCrosshatchPy.xml
|
||||
DrawCrosshatchPyImp.cpp
|
||||
DrawGeomHatchPy.xml
|
||||
DrawGeomHatchPyImp.cpp
|
||||
DrawViewCollectionPy.xml
|
||||
DrawViewCollectionPyImp.cpp
|
||||
DrawProjGroupPy.xml
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
|
||||
#include "PreCompiled.h"
|
||||
|
||||
#include "DrawCrosshatch.h"
|
||||
|
||||
// inclusion of the generated files (generated out of DrawCrosshatchPy.xml)
|
||||
#include <Mod/TechDraw/App/DrawCrosshatchPy.h>
|
||||
#include <Mod/TechDraw/App/DrawCrosshatchPy.cpp>
|
||||
|
||||
using namespace TechDraw;
|
||||
|
||||
// returns a string which represents the object e.g. when printed in python
|
||||
std::string DrawCrosshatchPy::representation(void) const
|
||||
{
|
||||
return std::string("<DrawCrosshatch object>");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
PyObject *DrawCrosshatchPy::getCustomAttributes(const char* /*attr*/) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int DrawCrosshatchPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -65,39 +65,39 @@
|
||||
#include "Geometry.h"
|
||||
#include "DrawViewPart.h"
|
||||
#include "DrawViewSection.h"
|
||||
#include "DrawCrosshatch.h"
|
||||
#include "DrawGeomHatch.h"
|
||||
|
||||
#include <Mod/TechDraw/App/DrawCrosshatchPy.h> // generated from DrawCrosshatchPy.xml
|
||||
#include <Mod/TechDraw/App/DrawGeomHatchPy.h> // generated from DrawGeomHatchPy.xml
|
||||
|
||||
using namespace TechDraw;
|
||||
using namespace TechDrawGeometry;
|
||||
using namespace std;
|
||||
|
||||
PROPERTY_SOURCE(TechDraw::DrawCrosshatch, App::DocumentObject)
|
||||
PROPERTY_SOURCE(TechDraw::DrawGeomHatch, App::DocumentObject)
|
||||
|
||||
|
||||
DrawCrosshatch::DrawCrosshatch(void)
|
||||
DrawGeomHatch::DrawGeomHatch(void)
|
||||
{
|
||||
static const char *vgroup = "Crosshatch";
|
||||
static const char *vgroup = "GeomHatch";
|
||||
|
||||
ADD_PROPERTY_TYPE(Source,(0),vgroup,(App::PropertyType)(App::Prop_None),"The View + Face to be crosshatched");
|
||||
ADD_PROPERTY_TYPE(FilePattern ,(""),vgroup,App::Prop_None,"The crosshatch pattern file for this area");
|
||||
ADD_PROPERTY_TYPE(NamePattern,(""),vgroup,App::Prop_None,"The name of the pattern");
|
||||
ADD_PROPERTY_TYPE(ScalePattern,(1.0),vgroup,App::Prop_None,"Crosshatch pattern size adjustment");
|
||||
ADD_PROPERTY_TYPE(ScalePattern,(1.0),vgroup,App::Prop_None,"GeomHatch pattern size adjustment");
|
||||
|
||||
getParameters();
|
||||
|
||||
}
|
||||
|
||||
DrawCrosshatch::~DrawCrosshatch()
|
||||
DrawGeomHatch::~DrawGeomHatch()
|
||||
{
|
||||
}
|
||||
|
||||
void DrawCrosshatch::onChanged(const App::Property* prop)
|
||||
void DrawGeomHatch::onChanged(const App::Property* prop)
|
||||
{
|
||||
if (prop == &Source ) {
|
||||
if (!isRestoring()) {
|
||||
DrawCrosshatch::execute();
|
||||
DrawGeomHatch::execute();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ void DrawCrosshatch::onChanged(const App::Property* prop)
|
||||
App::DocumentObject::onChanged(prop);
|
||||
}
|
||||
|
||||
short DrawCrosshatch::mustExecute() const
|
||||
short DrawGeomHatch::mustExecute() const
|
||||
{
|
||||
short result = 0;
|
||||
if (!isRestoring()) {
|
||||
@@ -136,20 +136,20 @@ short DrawCrosshatch::mustExecute() const
|
||||
}
|
||||
|
||||
|
||||
App::DocumentObjectExecReturn *DrawCrosshatch::execute(void)
|
||||
App::DocumentObjectExecReturn *DrawGeomHatch::execute(void)
|
||||
{
|
||||
|
||||
return App::DocumentObject::StdReturn;
|
||||
}
|
||||
|
||||
DrawViewPart* DrawCrosshatch::getSourceView(void) const
|
||||
DrawViewPart* DrawGeomHatch::getSourceView(void) const
|
||||
{
|
||||
App::DocumentObject* obj = Source.getValue();
|
||||
DrawViewPart* result = dynamic_cast<DrawViewPart*>(obj);
|
||||
return result;
|
||||
}
|
||||
|
||||
std::vector<HatchLine> DrawCrosshatch::getDecodedSpecsFromFile()
|
||||
std::vector<HatchLine> DrawGeomHatch::getDecodedSpecsFromFile()
|
||||
{
|
||||
std::string fileSpec = FilePattern.getValue();
|
||||
std::string myPattern = NamePattern.getValue();
|
||||
@@ -159,12 +159,12 @@ std::vector<HatchLine> DrawCrosshatch::getDecodedSpecsFromFile()
|
||||
|
||||
//!get all the specification lines and decode them into HatchLine structures
|
||||
/*static*/
|
||||
std::vector<HatchLine> DrawCrosshatch::getDecodedSpecsFromFile(std::string fileSpec, std::string myPattern)
|
||||
std::vector<HatchLine> DrawGeomHatch::getDecodedSpecsFromFile(std::string fileSpec, std::string myPattern)
|
||||
{
|
||||
std::vector<HatchLine> result;
|
||||
Base::FileInfo fi(fileSpec);
|
||||
if (!fi.isReadable()) {
|
||||
Base::Console().Error("DrawCrosshatch::getDecodedSpecsFromFile not able to open %s!\n",fileSpec.c_str());
|
||||
Base::Console().Error("DrawGeomHatch::getDecodedSpecsFromFile not able to open %s!\n",fileSpec.c_str());
|
||||
return result;
|
||||
}
|
||||
result = HatchLine::getSpecsForPattern(fileSpec,myPattern);
|
||||
@@ -172,7 +172,7 @@ std::vector<HatchLine> DrawCrosshatch::getDecodedSpecsFromFile(std::string fileS
|
||||
return result;
|
||||
}
|
||||
|
||||
std::vector<LineSet> DrawCrosshatch::getDrawableLines(int i) //get the drawable lines for face i
|
||||
std::vector<LineSet> DrawGeomHatch::getDrawableLines(int i) //get the drawable lines for face i
|
||||
{
|
||||
std::vector<LineSet> result;
|
||||
DrawViewPart* source = getSourceView();
|
||||
@@ -185,7 +185,7 @@ std::vector<LineSet> DrawCrosshatch::getDrawableLines(int i) //get the drawab
|
||||
}
|
||||
|
||||
/* static */
|
||||
std::vector<LineSet> DrawCrosshatch::getDrawableLines(DrawViewPart* source, std::vector<LineSet> lineSets, int iface, double scale )
|
||||
std::vector<LineSet> DrawGeomHatch::getDrawableLines(DrawViewPart* source, std::vector<LineSet> lineSets, int iface, double scale )
|
||||
{
|
||||
std::vector<LineSet> result;
|
||||
|
||||
@@ -230,7 +230,7 @@ std::vector<LineSet> DrawCrosshatch::getDrawableLines(DrawViewPart* source, std:
|
||||
|
||||
for (auto& ls: lineSets) {
|
||||
HatchLine hl = ls.getHatchLine();
|
||||
std::vector<TopoDS_Edge> candidates = DrawCrosshatch::makeEdgeOverlay(hl, bBox, scale);
|
||||
std::vector<TopoDS_Edge> candidates = DrawGeomHatch::makeEdgeOverlay(hl, bBox, scale);
|
||||
|
||||
//make Compound for this linespec
|
||||
BRep_Builder builder;
|
||||
@@ -275,7 +275,7 @@ std::vector<LineSet> DrawCrosshatch::getDrawableLines(DrawViewPart* source, std:
|
||||
return result;
|
||||
}
|
||||
/* static */
|
||||
std::vector<TopoDS_Edge> DrawCrosshatch::makeEdgeOverlay(HatchLine hl, Bnd_Box b, double scale)
|
||||
std::vector<TopoDS_Edge> DrawGeomHatch::makeEdgeOverlay(HatchLine hl, Bnd_Box b, double scale)
|
||||
{
|
||||
std::vector<TopoDS_Edge> result;
|
||||
|
||||
@@ -374,7 +374,7 @@ std::vector<TopoDS_Edge> DrawCrosshatch::makeEdgeOverlay(HatchLine hl, Bnd_Box b
|
||||
return result;
|
||||
}
|
||||
|
||||
TopoDS_Edge DrawCrosshatch::makeLine(Base::Vector3d s, Base::Vector3d e)
|
||||
TopoDS_Edge DrawGeomHatch::makeLine(Base::Vector3d s, Base::Vector3d e)
|
||||
{
|
||||
TopoDS_Edge result;
|
||||
gp_Pnt start(s.x,s.y,0.0);
|
||||
@@ -386,7 +386,7 @@ TopoDS_Edge DrawCrosshatch::makeLine(Base::Vector3d s, Base::Vector3d e)
|
||||
return result;
|
||||
}
|
||||
|
||||
void DrawCrosshatch::getParameters(void)
|
||||
void DrawGeomHatch::getParameters(void)
|
||||
{
|
||||
//this is probably "/build/data/Mod/TechDraw/PAT"
|
||||
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
|
||||
@@ -410,10 +410,10 @@ void DrawCrosshatch::getParameters(void)
|
||||
}
|
||||
|
||||
|
||||
PyObject *DrawCrosshatch::getPyObject(void)
|
||||
PyObject *DrawGeomHatch::getPyObject(void)
|
||||
{
|
||||
if (PythonObject.is(Py::_None())) {
|
||||
PythonObject = Py::Object(new DrawCrosshatchPy(this),true);
|
||||
PythonObject = Py::Object(new DrawGeomHatchPy(this),true);
|
||||
}
|
||||
return Py::new_reference_to(PythonObject);
|
||||
}
|
||||
@@ -422,12 +422,12 @@ PyObject *DrawCrosshatch::getPyObject(void)
|
||||
|
||||
namespace App {
|
||||
/// @cond DOXERR
|
||||
PROPERTY_SOURCE_TEMPLATE(TechDraw::DrawCrosshatchPython, TechDraw::DrawCrosshatch)
|
||||
template<> const char* TechDraw::DrawCrosshatchPython::getViewProviderName(void) const {
|
||||
return "TechDrawGui::ViewProviderCrosshatch";
|
||||
PROPERTY_SOURCE_TEMPLATE(TechDraw::DrawGeomHatchPython, TechDraw::DrawGeomHatch)
|
||||
template<> const char* TechDraw::DrawGeomHatchPython::getViewProviderName(void) const {
|
||||
return "TechDrawGui::ViewProviderGeomHatch";
|
||||
}
|
||||
/// @endcond
|
||||
|
||||
// explicit template instantiation
|
||||
template class TechDrawExport FeaturePythonT<TechDraw::DrawCrosshatch>;
|
||||
template class TechDrawExport FeaturePythonT<TechDraw::DrawGeomHatch>;
|
||||
}
|
||||
@@ -20,8 +20,8 @@
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef _TechDraw_DrawCrosshatch_h_
|
||||
#define _TechDraw_DrawCrosshatch_h_
|
||||
#ifndef _TechDraw_DrawGeomHatch_h_
|
||||
#define _TechDraw_DrawGeomHatch_h_
|
||||
|
||||
# include <App/DocumentObject.h>
|
||||
# include <App/FeaturePython.h>
|
||||
@@ -43,13 +43,13 @@ class HatchLine;
|
||||
class LineSet;
|
||||
class DashSet;
|
||||
|
||||
class TechDrawExport DrawCrosshatch : public App::DocumentObject
|
||||
class TechDrawExport DrawGeomHatch : public App::DocumentObject
|
||||
{
|
||||
PROPERTY_HEADER(TechDraw::DrawCrosshatch);
|
||||
PROPERTY_HEADER(TechDraw::DrawGeomHatch);
|
||||
|
||||
public:
|
||||
DrawCrosshatch();
|
||||
virtual ~DrawCrosshatch();
|
||||
DrawGeomHatch();
|
||||
virtual ~DrawGeomHatch();
|
||||
|
||||
App::PropertyLinkSub Source; //the dvX & face(s) this crosshatch belongs to
|
||||
App::PropertyFile FilePattern;
|
||||
@@ -60,7 +60,7 @@ public:
|
||||
virtual App::DocumentObjectExecReturn *execute(void);
|
||||
virtual void onChanged(const App::Property* prop);
|
||||
virtual const char* getViewProviderName(void) const {
|
||||
return "TechDrawGui::ViewProviderCrosshatch";
|
||||
return "TechDrawGui::ViewProviderGeomHatch";
|
||||
}
|
||||
virtual PyObject *getPyObject(void);
|
||||
|
||||
@@ -81,7 +81,7 @@ protected:
|
||||
private:
|
||||
};
|
||||
|
||||
typedef App::FeaturePythonT<DrawCrosshatch> DrawCrosshatchPython;
|
||||
typedef App::FeaturePythonT<DrawGeomHatch> DrawGeomHatchPython;
|
||||
|
||||
|
||||
|
||||
@@ -2,16 +2,16 @@
|
||||
<GenerateModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="generateMetaModel_Module.xsd">
|
||||
<PythonExport
|
||||
Father="DocumentObjectPy"
|
||||
Name="DrawCrosshatchPy"
|
||||
Twin="DrawCrosshatch"
|
||||
TwinPointer="DrawCrosshatch"
|
||||
Include="Mod/TechDraw/App/DrawCrosshatch.h"
|
||||
Name="DrawGeomHatchPy"
|
||||
Twin="DrawGeomHatch"
|
||||
TwinPointer="DrawGeomHatch"
|
||||
Include="Mod/TechDraw/App/DrawGeomHatch.h"
|
||||
Namespace="TechDraw"
|
||||
FatherInclude="App/DocumentObjectPy.h"
|
||||
FatherNamespace="App">
|
||||
<Documentation>
|
||||
<Author Licence="LGPL" Name="WandererFan" EMail="wandererfan@gmail.com" />
|
||||
<UserDocu>Feature for creating and manipulating Technical Drawing Crosshatch areas</UserDocu>
|
||||
<UserDocu>Feature for creating and manipulating Technical Drawing GeomHatch areas</UserDocu>
|
||||
</Documentation>
|
||||
<CustomAttributes />
|
||||
</PythonExport>
|
||||
32
src/Mod/TechDraw/App/DrawGeomHatchPyImp.cpp
Normal file
32
src/Mod/TechDraw/App/DrawGeomHatchPyImp.cpp
Normal file
@@ -0,0 +1,32 @@
|
||||
|
||||
#include "PreCompiled.h"
|
||||
|
||||
#include "DrawGeomHatch.h"
|
||||
|
||||
// inclusion of the generated files (generated out of DrawGeomHatchPy.xml)
|
||||
#include <Mod/TechDraw/App/DrawGeomHatchPy.h>
|
||||
#include <Mod/TechDraw/App/DrawGeomHatchPy.cpp>
|
||||
|
||||
using namespace TechDraw;
|
||||
|
||||
// returns a string which represents the object e.g. when printed in python
|
||||
std::string DrawGeomHatchPy::representation(void) const
|
||||
{
|
||||
return std::string("<DrawGeomHatch object>");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
PyObject *DrawGeomHatchPy::getCustomAttributes(const char* /*attr*/) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int DrawGeomHatchPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -89,7 +89,7 @@
|
||||
#include "GeometryObject.h"
|
||||
#include "DrawViewPart.h"
|
||||
#include "DrawHatch.h"
|
||||
#include "DrawCrosshatch.h"
|
||||
#include "DrawGeomHatch.h"
|
||||
#include "EdgeWalker.h"
|
||||
|
||||
|
||||
@@ -409,14 +409,14 @@ std::vector<TechDraw::DrawHatch*> DrawViewPart::getHatches() const
|
||||
return result;
|
||||
}
|
||||
|
||||
std::vector<TechDraw::DrawCrosshatch*> DrawViewPart::getCrosshatches() const
|
||||
std::vector<TechDraw::DrawGeomHatch*> DrawViewPart::getGeomHatches() const
|
||||
{
|
||||
std::vector<TechDraw::DrawCrosshatch*> result;
|
||||
std::vector<TechDraw::DrawGeomHatch*> result;
|
||||
std::vector<App::DocumentObject*> children = getInList();
|
||||
for (std::vector<App::DocumentObject*>::iterator it = children.begin(); it != children.end(); ++it) {
|
||||
if ((*it)->getTypeId().isDerivedFrom(DrawCrosshatch::getClassTypeId())) {
|
||||
TechDraw::DrawCrosshatch* cross = dynamic_cast<TechDraw::DrawCrosshatch*>(*it);
|
||||
result.push_back(cross);
|
||||
if ((*it)->getTypeId().isDerivedFrom(DrawGeomHatch::getClassTypeId())) {
|
||||
TechDraw::DrawGeomHatch* geom = dynamic_cast<TechDraw::DrawGeomHatch*>(*it);
|
||||
result.push_back(geom);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
||||
@@ -56,7 +56,7 @@ class Face;
|
||||
|
||||
namespace TechDraw {
|
||||
class DrawHatch;
|
||||
class DrawCrosshatch;
|
||||
class DrawGeomHatch;
|
||||
class DrawProjectSplit;
|
||||
class DrawViewSection;
|
||||
}
|
||||
@@ -99,7 +99,7 @@ public:
|
||||
|
||||
|
||||
std::vector<TechDraw::DrawHatch*> getHatches(void) const;
|
||||
std::vector<TechDraw::DrawCrosshatch*> getCrosshatches(void) const;
|
||||
std::vector<TechDraw::DrawGeomHatch*> getGeomHatches(void) const;
|
||||
|
||||
//TODO: are there use-cases for Python access to TechDrawGeometry???
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
#include "DrawUtil.h"
|
||||
#include "DrawProjGroupItem.h"
|
||||
#include "DrawProjectSplit.h"
|
||||
#include "DrawCrosshatch.h"
|
||||
#include "DrawGeomHatch.h"
|
||||
#include "DrawViewSection.h"
|
||||
|
||||
using namespace TechDraw;
|
||||
@@ -174,7 +174,7 @@ void DrawViewSection::onChanged(const App::Property* prop)
|
||||
if ((!FileHatchPattern.isEmpty()) &&
|
||||
(!NameGeomPattern.isEmpty())) {
|
||||
std::vector<HatchLine> specs =
|
||||
DrawCrosshatch::getDecodedSpecsFromFile(FileHatchPattern.getValue(),NameGeomPattern.getValue());
|
||||
DrawGeomHatch::getDecodedSpecsFromFile(FileHatchPattern.getValue(),NameGeomPattern.getValue());
|
||||
m_lineSets.clear();
|
||||
for (auto& hl: specs) {
|
||||
//hl.dump("hl from section");
|
||||
@@ -539,7 +539,7 @@ Base::Vector3d DrawViewSection::getSectionVector (const std::string sectionName)
|
||||
std::vector<LineSet> DrawViewSection::getDrawableLines(int i)
|
||||
{
|
||||
std::vector<LineSet> result;
|
||||
result = DrawCrosshatch::getDrawableLines(this,m_lineSets,i,HatchScale.getValue());
|
||||
result = DrawGeomHatch::getDrawableLines(this,m_lineSets,i,HatchScale.getValue());
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ class Face;
|
||||
namespace TechDraw
|
||||
{
|
||||
class DrawProjGroupItem;
|
||||
class DrawCrosshatch;
|
||||
class DrawGeomHatch;
|
||||
class HatchLine;
|
||||
class LineSet;
|
||||
class DashSet;
|
||||
|
||||
Reference in New Issue
Block a user