Skip to content

Commit

Permalink
more /Drawing/TechDraw/ edits. VP name conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
WandererFan authored and wwmayer committed Jul 11, 2016
1 parent 008a19d commit a46fd85
Show file tree
Hide file tree
Showing 58 changed files with 349 additions and 376 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Expand Up @@ -90,7 +90,7 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
# get linker errors as soon as possible and not at runtime e.g. for modules
if(UNIX)
# SET(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined")
SET(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined")
endif(UNIX)
endif(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX)

Expand Down
12 changes: 6 additions & 6 deletions src/Mod/TechDraw/App/AppTechDraw.cpp
Expand Up @@ -33,15 +33,15 @@
#include "DrawViewClip.h"
#include "DrawHatch.h"

extern struct PyMethodDef Drawing_methods[];
extern struct PyMethodDef TechDraw_methods[];

PyDoc_STRVAR(module_drawing_doc,
"This module is the Drawing module.");
PyDoc_STRVAR(module_techdraw_doc,
"This module is the TechDraw module.");


/* Python entry */
extern "C" {
void TechDrawExport initDrawing()
void TechDrawExport initTechDraw()
{
// load dependent module
try {
Expand All @@ -53,8 +53,8 @@ void TechDrawExport initDrawing()
PyErr_SetString(PyExc_ImportError, e.what());
return;
}
Py_InitModule3("Drawing", Drawing_methods, module_drawing_doc); /* mod name, table ptr */
Base::Console().Log("Loading Drawing module... done\n");
Py_InitModule3("TechDraw", TechDraw_methods, module_techdraw_doc); /* mod name, table ptr */
Base::Console().Log("Loading TechDraw module... done\n");


// NOTE: To finish the initialization of our own type objects we must
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/TechDraw/App/AppTechDrawPy.cpp
Expand Up @@ -57,7 +57,7 @@ tdPlaceholder(PyObject *self, PyObject *args)
}

/* registration table */
struct PyMethodDef Drawing_methods[] = {
struct PyMethodDef TechDraw_methods[] = {
{"tdPlaceholder" ,tdPlaceholder ,METH_VARARGS,
"[n/a] = tdPlaceholder(n/a) -- Temporary hack."},
{NULL, NULL} /* end of table marker */
Expand Down
4 changes: 2 additions & 2 deletions src/Mod/TechDraw/App/DrawHatch.h
Expand Up @@ -20,8 +20,8 @@
* *
***************************************************************************/

#ifndef _Drawing_DrawHatch_h_
#define _Drawing_DrawHatch_h_
#ifndef _TechDraw_DrawHatch_h_
#define _TechDraw_DrawHatch_h_

# include <App/DocumentObject.h>
# include <App/FeaturePython.h>
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/TechDraw/App/DrawPage.h
Expand Up @@ -60,7 +60,7 @@ class TechDrawExport DrawPage: public App::DocumentObject

/// returns the type name of the ViewProvider
virtual const char* getViewProviderName(void) const {
return "TechDrawGui::ViewProviderDrawingPage";
return "TechDrawGui::ViewProviderPage";
}

PyObject *getPyObject(void);
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/TechDraw/App/DrawPagePy.xml
Expand Up @@ -11,7 +11,7 @@
FatherNamespace="App">
<Documentation>
<Author Licence="LGPL" Name="WandererFan" EMail="wandererfan@gmail.com" />
<UserDocu>Feature for creating and manipulating Drawing Pages</UserDocu>
<UserDocu>Feature for creating and manipulating Technical Drawing Pages</UserDocu>
</Documentation>
<Methode Name="addView">
<Documentation>
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/TechDraw/App/DrawParametricTemplatePy.xml
Expand Up @@ -11,7 +11,7 @@
FatherNamespace="TechDraw">
<Documentation>
<Author Licence="LGPL" Name="Luke Parry" EMail="l.parry@warwick.ac.uk" />
<UserDocu>Feature for creating and manipulating Drawing Templates</UserDocu>
<UserDocu>Feature for creating and manipulating Technical Drawing Templates</UserDocu>
</Documentation>
<Methode Name="drawLine">
<Documentation>
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/TechDraw/App/DrawSVGTemplatePy.xml
Expand Up @@ -11,7 +11,7 @@
FatherNamespace="TechDraw">
<Documentation>
<Author Licence="LGPL" Name="Luke Parry" EMail="l.parry@warwick.ac.uk" />
<UserDocu>Feature for creating and manipulating Drawing SVG Templates</UserDocu>
<UserDocu>Feature for creating and manipulating Technical Drawing SVG Templates</UserDocu>
</Documentation>
</PythonExport>
</GenerateModel>
4 changes: 1 addition & 3 deletions src/Mod/TechDraw/App/DrawTemplate.h
Expand Up @@ -38,9 +38,7 @@ namespace TechDrawGeometry
namespace TechDraw
{

/** Base class of all View Features in the drawing module
*/
class TechDrawExport DrawTemplate: public App::DocumentObject
class TechDrawExport DrawTemplate : public App::DocumentObject
{
PROPERTY_HEADER(TechDraw::DrawTemplate);

Expand Down
2 changes: 1 addition & 1 deletion src/Mod/TechDraw/App/DrawTemplatePy.xml
Expand Up @@ -11,7 +11,7 @@
FatherNamespace="App">
<Documentation>
<Author Licence="LGPL" Name="Luke Parry" EMail="l.parry@warwick.ac.uk" />
<UserDocu>Feature for creating and manipulating Drawing Templates</UserDocu>
<UserDocu>Feature for creating and manipulating Technical Drawing Templates</UserDocu>
</Documentation>
</PythonExport>
</GenerateModel>
2 changes: 1 addition & 1 deletion src/Mod/TechDraw/App/DrawUtil.cpp
Expand Up @@ -44,7 +44,7 @@
namespace DrawUtil {

//==============================================================================
// convenient utility functions for Drawing Module
// convenient utility functions for TechDraw Module
//==============================================================================
extern "C" {
int TechDrawExport getIndexFromName(std::string geomName)
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/TechDraw/App/DrawView.cpp
Expand Up @@ -176,7 +176,7 @@ namespace App {
/// @cond DOXERR
PROPERTY_SOURCE_TEMPLATE(TechDraw::DrawViewPython, TechDraw::DrawView)
template<> const char* TechDraw::DrawViewPython::getViewProviderName(void) const {
return "TechDrawGui::ViewProviderView";
return "TechDrawGui::ViewProviderDrawingView";
}
/// @endcond

Expand Down
2 changes: 1 addition & 1 deletion src/Mod/TechDraw/App/DrawView.h
Expand Up @@ -63,7 +63,7 @@ class TechDrawExport DrawView : public App::DocumentObject

/// returns the type name of the ViewProvider
virtual const char* getViewProviderName(void) const {
return "TechDrawGui::ViewProviderView";
return "TechDrawGui::ViewProviderDrawingView";
}

DrawPage* findParentPage() const;
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/TechDraw/App/DrawViewClip.cpp
Expand Up @@ -164,7 +164,7 @@ namespace App {
/// @cond DOXERR
PROPERTY_SOURCE_TEMPLATE(TechDraw::DrawViewClipPython, TechDraw::DrawViewClip)
template<> const char* TechDraw::DrawViewClipPython::getViewProviderName(void) const {
return "TechDrawGui::ViewProviderDrawingClip";
return "TechDrawGui::ViewProviderDrawClip";
}
/// @endcond

Expand Down
2 changes: 1 addition & 1 deletion src/Mod/TechDraw/App/DrawViewClip.h
Expand Up @@ -64,7 +64,7 @@ class TechDrawExport DrawViewClip: public TechDraw::DrawView

/// returns the type name of the ViewProvider
virtual const char* getViewProviderName(void) const {
return "TechDrawGui::ViewProviderDrawingClip";
return "TechDrawGui::ViewProviderDrawClip";
}
std::vector<std::string> getChildViewNames();

Expand Down
4 changes: 2 additions & 2 deletions src/Mod/TechDraw/App/DrawViewDimension.h
Expand Up @@ -20,8 +20,8 @@
* *
***************************************************************************/

#ifndef _Drawing_DrawViewDimension_h_
#define _Drawing_DrawViewDimension_h_
#ifndef _TechDraw_DrawViewDimension_h_
#define _TechDraw_DrawViewDimension_h_

# include <App/DocumentObject.h>
# include <App/FeaturePython.h>
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/TechDraw/App/DrawViewPart.cpp
Expand Up @@ -462,7 +462,7 @@ namespace App {
/// @cond DOXERR
PROPERTY_SOURCE_TEMPLATE(TechDraw::DrawViewPartPython, TechDraw::DrawViewPart)
template<> const char* TechDraw::DrawViewPartPython::getViewProviderName(void) const {
return "TechDrawGui::ViewProviderView";
return "TechDrawGui::ViewProviderViewPart";
}
/// @endcond

Expand Down
2 changes: 1 addition & 1 deletion src/Mod/TechDraw/App/DrawViewPartPy.xml
Expand Up @@ -11,7 +11,7 @@
FatherNamespace="TechDraw">
<Documentation>
<Author Licence="LGPL" Name="WandererFan" EMail="wandererfan@gmail.com" />
<UserDocu>Feature for creating and manipulating Drawing Part Views</UserDocu>
<UserDocu>Feature for creating and manipulating Technical Drawing Part Views</UserDocu>
</Documentation>
<CustomAttributes />
</PythonExport>
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/TechDraw/App/DrawViewSection.cpp
Expand Up @@ -273,7 +273,7 @@ namespace App {
/// @cond DOXERR
PROPERTY_SOURCE_TEMPLATE(TechDraw::DrawViewSectionPython, TechDraw::DrawViewSection)
template<> const char* TechDraw::DrawViewSectionPython::getViewProviderName(void) const {
return "TechDrawGui::ViewProviderView";
return "TechDrawGui::ViewProviderDrawingView";
}
/// @endcond

Expand Down
20 changes: 10 additions & 10 deletions src/Mod/TechDraw/App/Makefile.am
@@ -1,7 +1,7 @@

lib_LTLIBRARIES=libDrawing.la Drawing.la

libDrawing_la_SOURCES=\
libTechDraw_la_SOURCES=\
AppDrawingPy.cpp \
TechDrawExport.cpp \
TechDrawExport.h \
Expand All @@ -26,12 +26,12 @@ libDrawing_la_SOURCES=\


# the library search path.
libDrawing_la_LDFLAGS = -L../../../Base -L../../../App -L../../../Mod/Part/App \
libTechDraw_la_LDFLAGS = -L../../../Base -L../../../App -L../../../Mod/Part/App \
-L$(OCC_LIB) $(all_libraries) \
-version-info @LIB_CURRENT@:@LIB_REVISION@:@LIB_AGE@
libDrawing_la_CPPFLAGS = -DTechDrawExport=
libTechDraw_la_CPPFLAGS = -DTechDrawExport=

libDrawing_la_LIBADD = \
libTechDraw_la_LIBADD = \
@BOOST_REGEX_LIB@ @BOOST_SYSTEM_LIB@ \
-l@PYTHON_LIB@ \
-lxerces-c \
Expand Down Expand Up @@ -61,18 +61,18 @@ libDrawing_la_LIBADD = \
#--------------------------------------------------------------------------------------
# Loader of libDrawing

Drawing_la_SOURCES=\
TechDraw_la_SOURCES=\
AppDrawing.cpp

# the library search path.
Drawing_la_LDFLAGS = $(libDrawing_la_LDFLAGS) -module -avoid-version
Drawing_la_CPPFLAGS = $(libDrawing_la_CPPFLAGS)
TechDraw_la_LDFLAGS = $(libTechDraw_la_LDFLAGS) -module -avoid-version
TechDraw_la_CPPFLAGS = $(libTechDraw_la_CPPFLAGS)

Drawing_la_LIBADD = \
$(libDrawing_la_LIBADD) \
TechDraw_la_LIBADD = \
$(libTechDraw_la_LIBADD) \
-lDrawing

Drawing_la_DEPENDENCIES = libDrawing.la
TechDraw_la_DEPENDENCIES = libDrawing.la

#--------------------------------------------------------------------------------------

Expand Down
28 changes: 14 additions & 14 deletions src/Mod/TechDraw/Gui/AppTechDrawGui.cpp
Expand Up @@ -36,7 +36,7 @@

#include "DlgPrefsDrawingImp.h"
#include "ViewProviderPage.h"
#include "ViewProviderView.h"
#include "ViewProviderDrawingView.h"
#include "ViewProviderDimension.h"
#include "ViewProviderProjGroup.h"
#include "ViewProviderProjGroupItem.h"
Expand All @@ -47,17 +47,17 @@
#include "ViewProviderSymbol.h"
#include "ViewProviderViewClip.h"
#include "ViewProviderHatch.h"
//#include "resources/qrc_Drawing.cpp"
//#include "resources/qrc_TechDraw.cpp"

// use a different name to CreateCommand()
void CreateDrawingCommands(void);
void CreateDrawingCommandsDims(void);
void CreateDrawingCommandsDecorate(void);
void CreateTechDrawCommands(void);
void CreateTechDrawCommandsDims(void);
void CreateTechDrawCommandsDecorate(void);

void loadDrawingResource()
void loadTechDrawResource()
{
// add resources and reloads the translators
Q_INIT_RESOURCE(Drawing);
Q_INIT_RESOURCE(TechDraw);
Gui::Translator::instance()->refresh();
}

Expand All @@ -75,12 +75,12 @@ void TechDrawGuiExport initTechDrawGui()
}

(void) Py_InitModule("TechDrawGui", TechDrawGui_Import_methods); /* mod name, table ptr */
Base::Console().Log("Loading GUI of Drawing module... done\n");
Base::Console().Log("Loading GUI of TechDraw module... done\n");

// instantiating the commands
CreateDrawingCommands();
CreateDrawingCommandsDims();
CreateDrawingCommandsDecorate();
CreateTechDrawCommands();
CreateTechDrawCommandsDims();
CreateTechDrawCommandsDecorate();

TechDrawGui::Workbench::init();

Expand All @@ -90,8 +90,8 @@ void TechDrawGuiExport initTechDrawGui()
QFontDatabase fontDB;
fontDB.addApplicationFont(QString::fromAscii(":/fonts/osifont.ttf"));

TechDrawGui::ViewProviderDrawingPage::init();
TechDrawGui::ViewProviderView::init();
TechDrawGui::ViewProviderPage::init();
TechDrawGui::ViewProviderDrawingView::init();

TechDrawGui::ViewProviderTemplate::init();
TechDrawGui::ViewProviderDimension::init();
Expand All @@ -108,7 +108,7 @@ void TechDrawGuiExport initTechDrawGui()
new Gui::PrefPageProducer<TechDrawGui::DlgPrefsDrawingImp> ("Drawing");

// add resources and reloads the translators
loadDrawingResource();
loadTechDrawResource();
}

} // extern "C" {
6 changes: 3 additions & 3 deletions src/Mod/TechDraw/Gui/CMakeLists.txt
Expand Up @@ -20,7 +20,7 @@ include_directories(
link_directories(${OCC_LIBRARY_DIR})

set(TechDrawGui_LIBS
Drawing
TechDraw
FreeCADGui
)

Expand Down Expand Up @@ -129,8 +129,8 @@ SET(TechDrawGuiView_SRCS
SET(TechDrawGuiViewProvider_SRCS
ViewProviderPage.cpp
ViewProviderPage.h
ViewProviderView.cpp
ViewProviderView.h
ViewProviderDrawingView.cpp
ViewProviderDrawingView.h
ViewProviderProjGroupItem.cpp
ViewProviderProjGroupItem.h
ViewProviderTemplate.cpp
Expand Down

0 comments on commit a46fd85

Please sign in to comment.