From fe05bdc94257a645f02010faca661dfe933d4d3c Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 14 Nov 2011 10:25:17 +0000 Subject: [PATCH] + remove SoFCSelection node from ViewProviderImagePlane because it causes major problems to be used as construction plan for drafting git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5130 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d --- src/Mod/Image/Gui/ViewProviderImagePlane.cpp | 30 +++++--------------- src/Mod/Image/Gui/ViewProviderImagePlane.h | 4 +-- 2 files changed, 8 insertions(+), 26 deletions(-) diff --git a/src/Mod/Image/Gui/ViewProviderImagePlane.cpp b/src/Mod/Image/Gui/ViewProviderImagePlane.cpp index 92c536a1e..7ae883eb4 100644 --- a/src/Mod/Image/Gui/ViewProviderImagePlane.cpp +++ b/src/Mod/Image/Gui/ViewProviderImagePlane.cpp @@ -58,28 +58,16 @@ PROPERTY_SOURCE(ImageGui::ViewProviderImagePlane, Gui::ViewProviderGeometryObjec ViewProviderImagePlane::ViewProviderImagePlane() { - pcImagePlaneRoot = new Gui::SoFCSelection(); - pcImagePlaneRoot->highlightMode = Gui::SoFCSelection::OFF; - pcImagePlaneRoot->selectionMode = Gui::SoFCSelection::SEL_OFF; - //pcImageRoot->style = Gui::SoFCSelection::BOX; - pcImagePlaneRoot->ref(); - texture = new SoTexture2; texture->ref(); pcCoords = new SoCoordinate3(); pcCoords->ref(); - pcDrawStyle = new SoDrawStyle(); - pcDrawStyle->ref(); - pcDrawStyle->style = SoDrawStyle::LINES; - pcDrawStyle->lineWidth = 2; } ViewProviderImagePlane::~ViewProviderImagePlane() { - pcImagePlaneRoot->unref(); pcCoords->unref(); - pcDrawStyle->unref(); texture->unref(); } @@ -87,7 +75,9 @@ void ViewProviderImagePlane::attach(App::DocumentObject *pcObj) { ViewProviderDocumentObject::attach(pcObj); - //// Draw trajectory lines + // NOTE: SoFCSelection node has beem removed because it led to + // problems using the image as a construction plan with the + // draft commands SoSeparator* planesep = new SoSeparator; planesep->addChild(pcCoords); @@ -102,7 +92,6 @@ void ViewProviderImagePlane::attach(App::DocumentObject *pcObj) texture->model = SoTexture2::MODULATE; planesep->addChild(texture); - //planesep->addChild( pcDrawStyle ); // plane pcCoords->point.set1Value(0,0,0,0); pcCoords->point.set1Value(1,1,0,0); @@ -110,21 +99,16 @@ void ViewProviderImagePlane::attach(App::DocumentObject *pcObj) pcCoords->point.set1Value(3,0,1,0); SoFaceSet *faceset = new SoFaceSet; faceset->numVertices.set1Value(0,4); - planesep->addChild( faceset ); + planesep->addChild(faceset); - pcImagePlaneRoot->addChild(planesep); - - addDisplayMaskMode(pcImagePlaneRoot, "ImagePlane"); - pcImagePlaneRoot->objectName = pcObj->getNameInDocument(); - pcImagePlaneRoot->documentName = pcObj->getDocument()->getName(); - pcImagePlaneRoot->subElementName = "Main"; + addDisplayMaskMode(planesep, "ImagePlane"); } void ViewProviderImagePlane::setDisplayMode(const char* ModeName) { - if ( strcmp("ImagePlane",ModeName)==0 ) + if (strcmp("ImagePlane",ModeName) == 0) setDisplayMaskMode("ImagePlane"); - ViewProviderGeometryObject::setDisplayMode( ModeName ); + ViewProviderGeometryObject::setDisplayMode(ModeName); } std::vector ViewProviderImagePlane::getDisplayModes(void) const diff --git a/src/Mod/Image/Gui/ViewProviderImagePlane.h b/src/Mod/Image/Gui/ViewProviderImagePlane.h index cf03ce246..9a1240161 100644 --- a/src/Mod/Image/Gui/ViewProviderImagePlane.h +++ b/src/Mod/Image/Gui/ViewProviderImagePlane.h @@ -28,7 +28,7 @@ #include class SoCoordinate3; -class SoDrawStyle; +class SoDrawStyle; class SoTexture2; class QImage; @@ -55,9 +55,7 @@ private: bool loadSvg(const char*, float x, float y, QImage& img); protected: - Gui::SoFCSelection * pcImagePlaneRoot; SoCoordinate3 * pcCoords; - SoDrawStyle * pcDrawStyle; SoTexture2 * texture; };