From 776ed8f2c1cb1b163a36cb19d524cd7aab78d8bb Mon Sep 17 00:00:00 2001 From: liukaiwen Date: Sat, 20 Jul 2024 01:07:04 +0800 Subject: [PATCH 1/2] refactor: move some nodes to Inventor folder --- src/Gui/CMakeLists.txt | 16 +- src/Gui/CommandView.cpp | 2 +- src/Gui/{ => Inventor}/So3DAnnotation.cpp | 7 +- src/Gui/{ => Inventor}/So3DAnnotation.h | 0 src/Gui/{ => Inventor}/SoAxisCrossKit.cpp | 3 - src/Gui/{ => Inventor}/SoAxisCrossKit.h | 240 ++++---- src/Gui/Inventor/SoDrawingGrid.cpp | 12 +- src/Gui/{ => Inventor}/SoFCBoundingBox.cpp | 542 +++++++++--------- src/Gui/{ => Inventor}/SoFCBoundingBox.h | 212 +++---- src/Gui/{ => Inventor}/SoMouseWheelEvent.cpp | 0 src/Gui/{ => Inventor}/SoMouseWheelEvent.h | 0 src/Gui/InventorNavigationStyle.cpp | 2 +- src/Gui/ManualAlignment.cpp | 7 +- src/Gui/NavigationStyle.cpp | 2 +- src/Gui/Quarter/Mouse.cpp | 2 +- src/Gui/SoFCCSysDragger.cpp | 2 +- src/Gui/SoFCCSysDragger.h | 2 - src/Gui/SoFCDB.cpp | 8 +- src/Gui/View3DInventorViewer.cpp | 4 +- src/Gui/View3DPy.cpp | 2 +- src/Gui/ViewProvider.cpp | 2 +- src/Gui/ViewProviderGeometryObject.cpp | 5 +- src/Mod/CAM/Gui/ViewProviderPath.cpp | 4 +- src/Mod/Part/Gui/ViewProvider2DObject.cpp | 2 +- .../Part/Gui/ViewProviderGridExtension.cpp | 2 +- src/Mod/Sketcher/Gui/EditModeCoinManager.cpp | 2 +- 26 files changed, 537 insertions(+), 545 deletions(-) rename src/Gui/{ => Inventor}/So3DAnnotation.cpp (97%) rename src/Gui/{ => Inventor}/So3DAnnotation.h (100%) rename src/Gui/{ => Inventor}/SoAxisCrossKit.cpp (99%) rename src/Gui/{ => Inventor}/SoAxisCrossKit.h (97%) rename src/Gui/{ => Inventor}/SoFCBoundingBox.cpp (96%) rename src/Gui/{ => Inventor}/SoFCBoundingBox.h (97%) rename src/Gui/{ => Inventor}/SoMouseWheelEvent.cpp (100%) rename src/Gui/{ => Inventor}/SoMouseWheelEvent.h (100%) diff --git a/src/Gui/CMakeLists.txt b/src/Gui/CMakeLists.txt index 93fd4262a0..e4b7b7483a 100644 --- a/src/Gui/CMakeLists.txt +++ b/src/Gui/CMakeLists.txt @@ -1009,8 +1009,11 @@ SET(Inventor_CPP_SRCS Inventor/SoAutoZoomTranslation.cpp Inventor/MarkerBitmaps.cpp Inventor/SmSwitchboard.cpp + Inventor/SoFCBoundingBox.cpp + Inventor/So3DAnnotation.cpp + Inventor/SoAxisCrossKit.cpp + Inventor/SoMouseWheelEvent.cpp SoFCBackgroundGradient.cpp - SoFCBoundingBox.cpp SoFCColorBar.cpp SoFCColorBarNotifier.cpp SoFCColorGradient.cpp @@ -1025,12 +1028,9 @@ SET(Inventor_CPP_SRCS SoFCSelectionAction.cpp SoFCVectorizeSVGAction.cpp SoFCVectorizeU3DAction.cpp - So3DAnnotation.cpp - SoAxisCrossKit.cpp SoTextLabel.cpp SoDatumLabel.cpp SoTouchEvents.cpp - SoMouseWheelEvent.cpp SoFCCSysDragger.cpp ArcEngine.cpp ) @@ -1040,8 +1040,10 @@ SET(Inventor_SRCS Inventor/SoAutoZoomTranslation.h Inventor/MarkerBitmaps.h Inventor/SmSwitchboard.h + Inventor/SoFCBoundingBox.h + Inventor/SoAxisCrossKit.h + Inventor/SoMouseWheelEvent.h SoFCBackgroundGradient.h - SoFCBoundingBox.h SoFCColorBar.h SoFCColorBarNotifier.h SoFCColorGradient.h @@ -1056,11 +1058,9 @@ SET(Inventor_SRCS SoFCSelectionAction.h SoFCVectorizeSVGAction.h SoFCVectorizeU3DAction.h - SoAxisCrossKit.h SoTextLabel.h SoDatumLabel.h SoTouchEvents.h - SoMouseWheelEvent.h SoFCCSysDragger.h ArcEngine.h ) @@ -1297,7 +1297,7 @@ SET(FreeCADGui_SRCS ${Dock_Windows_SRCS} ${Editor_SRCS} ${Help_SRCS} - ${Inventor_SRCS} + ${Inventor_CPP_SRCS} ${Language_SRCS} ${Propertyeditor_SRCS} ${Task_View_SRCS} diff --git a/src/Gui/CommandView.cpp b/src/Gui/CommandView.cpp index f9b2d408ae..5213cdc108 100644 --- a/src/Gui/CommandView.cpp +++ b/src/Gui/CommandView.cpp @@ -65,6 +65,7 @@ #include "Document.h" #include "FileDialog.h" #include "ImageView.h" +#include "Inventor/SoAxisCrossKit.h" #include "Macro.h" #include "MainWindow.h" #include "NavigationStyle.h" @@ -73,7 +74,6 @@ #include "SceneInspector.h" #include "Selection.h" #include "SelectionObject.h" -#include "SoAxisCrossKit.h" #include "SoFCOffscreenRenderer.h" #include "TextureMapping.h" #include "Tools.h" diff --git a/src/Gui/So3DAnnotation.cpp b/src/Gui/Inventor/So3DAnnotation.cpp similarity index 97% rename from src/Gui/So3DAnnotation.cpp rename to src/Gui/Inventor/So3DAnnotation.cpp index a42662bb8b..b28126cf45 100644 --- a/src/Gui/So3DAnnotation.cpp +++ b/src/Gui/Inventor/So3DAnnotation.cpp @@ -23,11 +23,14 @@ #include "PreCompiled.h" #ifndef _PreComp_ -#include +#ifdef FC_OS_MACOSX +#include +#else +#include +#endif #include #endif -#include "SoFCDB.h" #include "So3DAnnotation.h" using namespace Gui; diff --git a/src/Gui/So3DAnnotation.h b/src/Gui/Inventor/So3DAnnotation.h similarity index 100% rename from src/Gui/So3DAnnotation.h rename to src/Gui/Inventor/So3DAnnotation.h diff --git a/src/Gui/SoAxisCrossKit.cpp b/src/Gui/Inventor/SoAxisCrossKit.cpp similarity index 99% rename from src/Gui/SoAxisCrossKit.cpp rename to src/Gui/Inventor/SoAxisCrossKit.cpp index 4c637e40af..ff02b98d29 100644 --- a/src/Gui/SoAxisCrossKit.cpp +++ b/src/Gui/Inventor/SoAxisCrossKit.cpp @@ -23,9 +23,6 @@ #include "PreCompiled.h" #ifndef _PreComp_ -# ifdef FC_OS_WIN32 -# include -# endif # ifdef FC_OS_MACOSX # include # else diff --git a/src/Gui/SoAxisCrossKit.h b/src/Gui/Inventor/SoAxisCrossKit.h similarity index 97% rename from src/Gui/SoAxisCrossKit.h rename to src/Gui/Inventor/SoAxisCrossKit.h index 922e35d13b..151f5f40c3 100644 --- a/src/Gui/SoAxisCrossKit.h +++ b/src/Gui/Inventor/SoAxisCrossKit.h @@ -1,120 +1,120 @@ -/*************************************************************************** - * Copyright (c) 2010 Werner Mayer * - * * - * This file is part of the FreeCAD CAx development system. * - * * - * This library is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Library General Public * - * License as published by the Free Software Foundation; either * - * version 2 of the License, or (at your option) any later version. * - * * - * This library is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU Library General Public License for more details. * - * * - * You should have received a copy of the GNU Library General Public * - * License along with this library; see the file COPYING.LIB. If not, * - * write to the Free Software Foundation, Inc., 59 Temple Place, * - * Suite 330, Boston, MA 02111-1307, USA * - * * - ***************************************************************************/ - -#ifndef GUI_SOSHAPESCALE_H -#define GUI_SOSHAPESCALE_H - -#include -#include -#include -#include -#include -#include -#include - - -class SbViewport; -class SoState; -class SbColor; -class SbVec2s; - -namespace Gui { -class GuiExport SoShapeScale : public SoBaseKit { - using inherited = SoBaseKit; - - SO_KIT_HEADER(SoShapeScale); - - SO_KIT_CATALOG_ENTRY_HEADER(topSeparator); - SO_KIT_CATALOG_ENTRY_HEADER(scale); - SO_KIT_CATALOG_ENTRY_HEADER(shape); - -public: - SoShapeScale(); - static void initClass(); - - SoSFFloat active; - SoSFFloat scaleFactor; - -protected: - void GLRender(SoGLRenderAction * action) override; - ~SoShapeScale() override; -}; - -class GuiExport SoAxisCrossKit : public SoBaseKit { - using inherited = SoBaseKit; - - SO_KIT_HEADER(SoAxisCrossKit); - - SO_KIT_CATALOG_ENTRY_HEADER(xAxis); - SO_KIT_CATALOG_ENTRY_HEADER(xHead); - SO_KIT_CATALOG_ENTRY_HEADER(yAxis); - SO_KIT_CATALOG_ENTRY_HEADER(yHead); - SO_KIT_CATALOG_ENTRY_HEADER(zAxis); - SO_KIT_CATALOG_ENTRY_HEADER(zHead); - -public: - SoAxisCrossKit(); - - // Overrides default method. All the parts are shapeKits, - // so this node will not affect the state. - SbBool affectsState() const override; - void addWriteReference(SoOutput * out, SbBool isfromfield = false) override; - void getBoundingBox(SoGetBoundingBoxAction * action) override; - - static void initClass(); - -private: - // Constructor calls to build and set up parts. - void createAxes(); - ~SoAxisCrossKit() override; -}; - -class GuiExport SoRegPoint : public SoShape { - using inherited = SoShape; - - SO_NODE_HEADER(SoRegPoint); - -public: - static void initClass(); - SoRegPoint(); - - void notify(SoNotList * node) override; - - SoSFVec3f base; - SoSFVec3f normal; - SoSFFloat length; - SoSFColor color; - SoSFString text; - -protected: - ~SoRegPoint() override; - void GLRender(SoGLRenderAction *action) override; - void computeBBox(SoAction *action, SbBox3f &box, SbVec3f ¢er) override; - void generatePrimitives(SoAction *action) override; - -private: - SoSeparator* root; -}; - -} // namespace Gui - -#endif // GUI_SOSHAPESCALE_H +/*************************************************************************** + * Copyright (c) 2010 Werner Mayer * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#ifndef GUI_SOSHAPESCALE_H +#define GUI_SOSHAPESCALE_H + +#include +#include +#include +#include +#include +#include +#include + + +class SbViewport; +class SoState; +class SbColor; +class SbVec2s; + +namespace Gui { +class GuiExport SoShapeScale : public SoBaseKit { + using inherited = SoBaseKit; + + SO_KIT_HEADER(SoShapeScale); + + SO_KIT_CATALOG_ENTRY_HEADER(topSeparator); + SO_KIT_CATALOG_ENTRY_HEADER(scale); + SO_KIT_CATALOG_ENTRY_HEADER(shape); + +public: + SoShapeScale(); + static void initClass(); + + SoSFFloat active; + SoSFFloat scaleFactor; + +protected: + void GLRender(SoGLRenderAction * action) override; + ~SoShapeScale() override; +}; + +class GuiExport SoAxisCrossKit : public SoBaseKit { + using inherited = SoBaseKit; + + SO_KIT_HEADER(SoAxisCrossKit); + + SO_KIT_CATALOG_ENTRY_HEADER(xAxis); + SO_KIT_CATALOG_ENTRY_HEADER(xHead); + SO_KIT_CATALOG_ENTRY_HEADER(yAxis); + SO_KIT_CATALOG_ENTRY_HEADER(yHead); + SO_KIT_CATALOG_ENTRY_HEADER(zAxis); + SO_KIT_CATALOG_ENTRY_HEADER(zHead); + +public: + SoAxisCrossKit(); + + // Overrides default method. All the parts are shapeKits, + // so this node will not affect the state. + SbBool affectsState() const override; + void addWriteReference(SoOutput * out, SbBool isfromfield = false) override; + void getBoundingBox(SoGetBoundingBoxAction * action) override; + + static void initClass(); + +private: + // Constructor calls to build and set up parts. + void createAxes(); + ~SoAxisCrossKit() override; +}; + +class GuiExport SoRegPoint : public SoShape { + using inherited = SoShape; + + SO_NODE_HEADER(SoRegPoint); + +public: + static void initClass(); + SoRegPoint(); + + void notify(SoNotList * node) override; + + SoSFVec3f base; + SoSFVec3f normal; + SoSFFloat length; + SoSFColor color; + SoSFString text; + +protected: + ~SoRegPoint() override; + void GLRender(SoGLRenderAction *action) override; + void computeBBox(SoAction *action, SbBox3f &box, SbVec3f ¢er) override; + void generatePrimitives(SoAction *action) override; + +private: + SoSeparator* root; +}; + +} // namespace Gui + +#endif // GUI_SOSHAPESCALE_H diff --git a/src/Gui/Inventor/SoDrawingGrid.cpp b/src/Gui/Inventor/SoDrawingGrid.cpp index 6bfe086d95..39e8c7042e 100644 --- a/src/Gui/Inventor/SoDrawingGrid.cpp +++ b/src/Gui/Inventor/SoDrawingGrid.cpp @@ -23,7 +23,6 @@ #include "PreCompiled.h" #ifndef _PreComp_ -# include # include # include # include @@ -31,13 +30,12 @@ # include # include # include -#endif - #ifdef FC_OS_MACOSX #include #else #include #endif +#endif #include "SoDrawingGrid.h" @@ -179,14 +177,14 @@ SoDrawingGrid::GLRenderOffPath(SoGLRenderAction *) void SoDrawingGrid::generatePrimitives(SoAction* action) { - Q_UNUSED(action); + (void)action; } void SoDrawingGrid::computeBBox(SoAction *action, SbBox3f &box, SbVec3f ¢er) { - Q_UNUSED(action); - Q_UNUSED(box); - Q_UNUSED(center); + (void)action; + (void)box; + (void)center; //SoState* state = action->getState(); } diff --git a/src/Gui/SoFCBoundingBox.cpp b/src/Gui/Inventor/SoFCBoundingBox.cpp similarity index 96% rename from src/Gui/SoFCBoundingBox.cpp rename to src/Gui/Inventor/SoFCBoundingBox.cpp index 3f4c38cb83..0b7761fa1b 100644 --- a/src/Gui/SoFCBoundingBox.cpp +++ b/src/Gui/Inventor/SoFCBoundingBox.cpp @@ -1,272 +1,270 @@ -/*************************************************************************** - * Copyright (c) 2007 Werner Mayer * - * * - * This file is part of the FreeCAD CAx development system. * - * * - * This library is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Library General Public * - * License as published by the Free Software Foundation; either * - * version 2 of the License, or (at your option) any later version. * - * * - * This library is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU Library General Public License for more details. * - * * - * You should have received a copy of the GNU Library General Public * - * License along with this library; see the file COPYING.LIB. If not, * - * write to the Free Software Foundation, Inc., 59 Temple Place, * - * Suite 330, Boston, MA 02111-1307, USA * - * * - ***************************************************************************/ - -#include "PreCompiled.h" - -#ifndef _PreComp_ -# include - -#include -#include -#include -#include -#include -#include -#include -#include -#endif - -#include "SoFCBoundingBox.h" - - -using namespace Gui; - -SO_NODE_SOURCE(SoFCBoundingBox) - -// vertices used to create a box -static const int32_t bBoxVerts[8][3] = -{ - {0, 0, 0}, - {1, 0, 0}, - {1, 1, 0}, - {0, 1, 0}, - {0, 0, 1}, - {1, 0, 1}, - {1, 1, 1}, - {0, 1, 1} -}; - -// indexes used to create the edges -static const int32_t bBoxEdges[36] = -{ - 0,1,-1, 1,2,-1, 2,3,-1, 3,0,-1, - 4,5,-1, 5,6,-1, 6,7,-1, 7,4,-1, - 0,4,-1, 1,5,-1, 2,6,-1, 3,7,-1 -}; - -void SoFCBoundingBox::initClass () -{ - SO_NODE_INIT_CLASS(SoFCBoundingBox, SoShape, "Shape"); -} - -SoFCBoundingBox::SoFCBoundingBox () -{ - SO_NODE_CONSTRUCTOR(SoFCBoundingBox); - - SO_NODE_ADD_FIELD(minBounds, (-1.0, -1.0, -1.0)); - SO_NODE_ADD_FIELD(maxBounds, ( 1.0, 1.0, 1.0)); - SO_NODE_ADD_FIELD(coordsOn, (true)); - SO_NODE_ADD_FIELD(dimensionsOn, (true)); - - root = new SoSeparator(); - auto bboxSep = new SoSeparator(); - - bboxCoords = new SoCoordinate3(); - bboxCoords->point.setNum(8); - bboxSep->addChild(bboxCoords); - root->addChild(bboxSep); - - // the lines of the box - bboxLines = new SoIndexedLineSet(); - bboxLines->coordIndex.setNum(36); - bboxLines->coordIndex.setValues(0, 36, bBoxEdges); - bboxSep->addChild(bboxLines); - - - // create the text nodes, including a transform for each vertice offset - textSep = new SoSeparator(); - for (int i = 0; i < 8; i++) { - auto temp = new SoSeparator(); - auto trans = new SoTransform(); - temp->addChild(trans); - auto text = new SoText2(); - text->justification.setValue(SoText2::CENTER); - temp->addChild(text); - textSep->addChild(temp); - } - - // create the text nodes, including a transform for each dimension - dimSep = new SoSeparator(); - for (int i = 0; i < 3; i++) { - auto temp = new SoSeparator(); - auto trans = new SoTransform(); - temp->addChild(trans); - auto text = new SoText2(); - text->justification.setValue(SoText2::CENTER); - temp->addChild(text); - dimSep->addChild(temp); - } - - root->addChild(textSep); - root->addChild(dimSep); - root->ref(); -} - -SoFCBoundingBox::~SoFCBoundingBox () -{ - root->unref(); -} - -void SoFCBoundingBox::GLRender (SoGLRenderAction *action) -{ - SbVec3f corner[2], ctr, *vptr; - SbBool coord, dimension; - - // grab the current state - //SoState *state = action->getState(); - - if (!shouldGLRender(action)) - return; - - // get the latest values from the fields - corner[0] = minBounds.getValue(); - corner[1] = maxBounds.getValue(); - coord = coordsOn.getValue(); - dimension = dimensionsOn.getValue(); - - // set the coordinates for the LineSet to point to - vptr = bboxCoords->point.startEditing(); - for (int i = 0; i < 8; i++) { - for (int j = 0; j < 3; j++) { - vptr[i][j] = corner[bBoxVerts[i][j]][j]; - } - } - - // if coord is true then set the text nodes - if (coord) { - ctr = (corner[1] - corner[0]) / 2.0f; - for (int i = 0; i < 8; i++) { - // create the string for the text - std::stringstream str; - str.precision(2); - str.setf(std::ios::fixed | std::ios::showpoint); - str << "(" << vptr[i][0] << "," << vptr[i][1] << "," << vptr[i][2] << ")"; - - SoSeparator *sep = static_cast(textSep->getChild(i)); - SoTransform *trans = static_cast(sep->getChild(0)); - - trans->translation.setValue(vptr[i].getValue()); - SoText2* t = static_cast(sep->getChild(1)); - t->string.setValue(str.str().c_str()); - } - - textSep->ref(); - if (root->findChild(textSep) < 0) - root->addChild(textSep); - } else { - if (root->findChild(textSep) >= 0) - root->removeChild(textSep); - } - - // if dimension is true then set the text nodes - if (dimension) { - ctr = (corner[1] - corner[0]) / 2.0f; - for (int i = 0; i < 3; i++) { - // create the string for the text - std::stringstream str; - str.precision(2); - str.setf(std::ios::fixed | std::ios::showpoint); - str << (2.0f * ctr[i]); - - SoSeparator *sep = static_cast(dimSep->getChild(i)); - SoTransform *trans = static_cast(sep->getChild(0)); - - SbVec3f point = corner[0]; - point[i] += ctr[i]; - trans->translation.setValue(point.getValue()); - SoText2* t = static_cast(sep->getChild(1)); - t->string.setValue(str.str().c_str()); - } - - dimSep->ref(); - if (root->findChild(dimSep) < 0) - root->addChild(dimSep); - } else { - if (root->findChild(dimSep) >= 0) - root->removeChild(dimSep); - } - - bboxCoords->point.finishEditing(); - - // Avoid shading - SoState * state = action->getState(); - state->push(); - SoLazyElement::setLightModel(state, SoLazyElement::BASE_COLOR); - root->GLRender(action); - state->pop(); -} - -void SoFCBoundingBox::generatePrimitives (SoAction * /*action*/) -{ -} - -void SoFCBoundingBox::computeBBox (SoAction * /*action*/, SbBox3f &box, SbVec3f ¢er) -{ - center = (minBounds.getValue() + maxBounds.getValue()) / 2.0f; - box.setBounds(minBounds.getValue(), maxBounds.getValue()); -} - -void SoFCBoundingBox::finish() -{ - atexit_cleanup(); -} - -// --------------------------------------------------------------- - -SO_NODE_SOURCE(SoSkipBoundingGroup) - -/*! - Constructor. -*/ -SoSkipBoundingGroup::SoSkipBoundingGroup() -{ - SO_NODE_CONSTRUCTOR(SoSkipBoundingGroup); - - SO_NODE_ADD_FIELD(mode, (INCLUDE_BBOX)); - - SO_NODE_DEFINE_ENUM_VALUE(Modes, INCLUDE_BBOX); - SO_NODE_DEFINE_ENUM_VALUE(Modes, EXCLUDE_BBOX); - SO_NODE_SET_SF_ENUM_TYPE (mode, Modes); -} - -/*! - Destructor. -*/ -SoSkipBoundingGroup::~SoSkipBoundingGroup() = default; - -void -SoSkipBoundingGroup::initClass() -{ - SO_NODE_INIT_CLASS(SoSkipBoundingGroup,SoGroup,"Group"); -} - -void SoSkipBoundingGroup::finish() -{ - atexit_cleanup(); -} - -void SoSkipBoundingGroup::getBoundingBox(SoGetBoundingBoxAction *action) -{ - if (mode.getValue() == INCLUDE_BBOX) - inherited::getBoundingBox(action); -} - +/*************************************************************************** + * Copyright (c) 2007 Werner Mayer * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#include "PreCompiled.h" + +#ifndef _PreComp_ +# include + +#include +#include +#include +#include +#include +#include +#endif + +#include "SoFCBoundingBox.h" + + +using namespace Gui; + +SO_NODE_SOURCE(SoFCBoundingBox) + +// vertices used to create a box +static const int32_t bBoxVerts[8][3] = +{ + {0, 0, 0}, + {1, 0, 0}, + {1, 1, 0}, + {0, 1, 0}, + {0, 0, 1}, + {1, 0, 1}, + {1, 1, 1}, + {0, 1, 1} +}; + +// indexes used to create the edges +static const int32_t bBoxEdges[36] = +{ + 0,1,-1, 1,2,-1, 2,3,-1, 3,0,-1, + 4,5,-1, 5,6,-1, 6,7,-1, 7,4,-1, + 0,4,-1, 1,5,-1, 2,6,-1, 3,7,-1 +}; + +void SoFCBoundingBox::initClass () +{ + SO_NODE_INIT_CLASS(SoFCBoundingBox, SoShape, "Shape"); +} + +SoFCBoundingBox::SoFCBoundingBox () +{ + SO_NODE_CONSTRUCTOR(SoFCBoundingBox); + + SO_NODE_ADD_FIELD(minBounds, (-1.0, -1.0, -1.0)); + SO_NODE_ADD_FIELD(maxBounds, ( 1.0, 1.0, 1.0)); + SO_NODE_ADD_FIELD(coordsOn, (true)); + SO_NODE_ADD_FIELD(dimensionsOn, (true)); + + root = new SoSeparator(); + auto bboxSep = new SoSeparator(); + + bboxCoords = new SoCoordinate3(); + bboxCoords->point.setNum(8); + bboxSep->addChild(bboxCoords); + root->addChild(bboxSep); + + // the lines of the box + bboxLines = new SoIndexedLineSet(); + bboxLines->coordIndex.setNum(36); + bboxLines->coordIndex.setValues(0, 36, bBoxEdges); + bboxSep->addChild(bboxLines); + + + // create the text nodes, including a transform for each vertice offset + textSep = new SoSeparator(); + for (int i = 0; i < 8; i++) { + auto temp = new SoSeparator(); + auto trans = new SoTransform(); + temp->addChild(trans); + auto text = new SoText2(); + text->justification.setValue(SoText2::CENTER); + temp->addChild(text); + textSep->addChild(temp); + } + + // create the text nodes, including a transform for each dimension + dimSep = new SoSeparator(); + for (int i = 0; i < 3; i++) { + auto temp = new SoSeparator(); + auto trans = new SoTransform(); + temp->addChild(trans); + auto text = new SoText2(); + text->justification.setValue(SoText2::CENTER); + temp->addChild(text); + dimSep->addChild(temp); + } + + root->addChild(textSep); + root->addChild(dimSep); + root->ref(); +} + +SoFCBoundingBox::~SoFCBoundingBox () +{ + root->unref(); +} + +void SoFCBoundingBox::GLRender (SoGLRenderAction *action) +{ + SbVec3f corner[2], ctr, *vptr; + SbBool coord, dimension; + + // grab the current state + //SoState *state = action->getState(); + + if (!shouldGLRender(action)) + return; + + // get the latest values from the fields + corner[0] = minBounds.getValue(); + corner[1] = maxBounds.getValue(); + coord = coordsOn.getValue(); + dimension = dimensionsOn.getValue(); + + // set the coordinates for the LineSet to point to + vptr = bboxCoords->point.startEditing(); + for (int i = 0; i < 8; i++) { + for (int j = 0; j < 3; j++) { + vptr[i][j] = corner[bBoxVerts[i][j]][j]; + } + } + + // if coord is true then set the text nodes + if (coord) { + ctr = (corner[1] - corner[0]) / 2.0f; + for (int i = 0; i < 8; i++) { + // create the string for the text + std::stringstream str; + str.precision(2); + str.setf(std::ios::fixed | std::ios::showpoint); + str << "(" << vptr[i][0] << "," << vptr[i][1] << "," << vptr[i][2] << ")"; + + SoSeparator *sep = static_cast(textSep->getChild(i)); + SoTransform *trans = static_cast(sep->getChild(0)); + + trans->translation.setValue(vptr[i].getValue()); + SoText2* t = static_cast(sep->getChild(1)); + t->string.setValue(str.str().c_str()); + } + + textSep->ref(); + if (root->findChild(textSep) < 0) + root->addChild(textSep); + } else { + if (root->findChild(textSep) >= 0) + root->removeChild(textSep); + } + + // if dimension is true then set the text nodes + if (dimension) { + ctr = (corner[1] - corner[0]) / 2.0f; + for (int i = 0; i < 3; i++) { + // create the string for the text + std::stringstream str; + str.precision(2); + str.setf(std::ios::fixed | std::ios::showpoint); + str << (2.0f * ctr[i]); + + SoSeparator *sep = static_cast(dimSep->getChild(i)); + SoTransform *trans = static_cast(sep->getChild(0)); + + SbVec3f point = corner[0]; + point[i] += ctr[i]; + trans->translation.setValue(point.getValue()); + SoText2* t = static_cast(sep->getChild(1)); + t->string.setValue(str.str().c_str()); + } + + dimSep->ref(); + if (root->findChild(dimSep) < 0) + root->addChild(dimSep); + } else { + if (root->findChild(dimSep) >= 0) + root->removeChild(dimSep); + } + + bboxCoords->point.finishEditing(); + + // Avoid shading + SoState * state = action->getState(); + state->push(); + SoLazyElement::setLightModel(state, SoLazyElement::BASE_COLOR); + root->GLRender(action); + state->pop(); +} + +void SoFCBoundingBox::generatePrimitives (SoAction * /*action*/) +{ +} + +void SoFCBoundingBox::computeBBox (SoAction * /*action*/, SbBox3f &box, SbVec3f ¢er) +{ + center = (minBounds.getValue() + maxBounds.getValue()) / 2.0f; + box.setBounds(minBounds.getValue(), maxBounds.getValue()); +} + +void SoFCBoundingBox::finish() +{ + atexit_cleanup(); +} + +// --------------------------------------------------------------- + +SO_NODE_SOURCE(SoSkipBoundingGroup) + +/*! + Constructor. +*/ +SoSkipBoundingGroup::SoSkipBoundingGroup() +{ + SO_NODE_CONSTRUCTOR(SoSkipBoundingGroup); + + SO_NODE_ADD_FIELD(mode, (INCLUDE_BBOX)); + + SO_NODE_DEFINE_ENUM_VALUE(Modes, INCLUDE_BBOX); + SO_NODE_DEFINE_ENUM_VALUE(Modes, EXCLUDE_BBOX); + SO_NODE_SET_SF_ENUM_TYPE (mode, Modes); +} + +/*! + Destructor. +*/ +SoSkipBoundingGroup::~SoSkipBoundingGroup() = default; + +void +SoSkipBoundingGroup::initClass() +{ + SO_NODE_INIT_CLASS(SoSkipBoundingGroup,SoGroup,"Group"); +} + +void SoSkipBoundingGroup::finish() +{ + atexit_cleanup(); +} + +void SoSkipBoundingGroup::getBoundingBox(SoGetBoundingBoxAction *action) +{ + if (mode.getValue() == INCLUDE_BBOX) + inherited::getBoundingBox(action); +} + diff --git a/src/Gui/SoFCBoundingBox.h b/src/Gui/Inventor/SoFCBoundingBox.h similarity index 97% rename from src/Gui/SoFCBoundingBox.h rename to src/Gui/Inventor/SoFCBoundingBox.h index b394d4942a..d33bf51cde 100644 --- a/src/Gui/SoFCBoundingBox.h +++ b/src/Gui/Inventor/SoFCBoundingBox.h @@ -1,106 +1,106 @@ -/*************************************************************************** - * Copyright (c) 2007 Werner Mayer * - * * - * This file is part of the FreeCAD CAx development system. * - * * - * This library is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Library General Public * - * License as published by the Free Software Foundation; either * - * version 2 of the License, or (at your option) any later version. * - * * - * This library is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU Library General Public License for more details. * - * * - * You should have received a copy of the GNU Library General Public * - * License along with this library; see the file COPYING.LIB. If not, * - * write to the Free Software Foundation, Inc., 59 Temple Place, * - * Suite 330, Boston, MA 02111-1307, USA * - * * - ***************************************************************************/ - -#ifndef COIN_SOFCBOUNDINGBOX_H -#define COIN_SOFCBOUNDINGBOX_H - -#include -#include -#include -#include -#include -#include -#include -#include - - -namespace Gui { - -/** - * A subclass of SoShape used to create an axis aligned wire frame box based - * on the minBounds and maxBounds fields. The class also has a field which - * can be toggled on or off for displaying text coordinate labels at the - * vertices of the box. - * @note Original source are taken from http://www.wheatchex.com/projects/openinventor/bbox/BoundingBox.h and - * http://www.wheatchex.com/projects/openinventor/bbox/BoundingBox.cpp - * @date November 12th, 2001 - * @author Josh Grant - */ -class GuiExport SoFCBoundingBox : public SoShape { - using inherited = SoShape; - - SO_NODE_HEADER(Gui::SoFCBoundingBox); - -public: - static void initClass(); - static void finish(); - -public: - SoFCBoundingBox(); - SoSFVec3f minBounds; /**< minimum box coordinates */ - SoSFVec3f maxBounds; /**< maximum box coordinates */ - SoSFBool coordsOn; /**< If true, the coordinates are displayed at each vertex */ - SoSFBool dimensionsOn; /**< If true, the dimensions are displayed in x,y and z direction */ - - -protected: - ~SoFCBoundingBox() override; - void GLRender(SoGLRenderAction *action) override; - void generatePrimitives (SoAction *action) override; - void computeBBox(SoAction *action, SbBox3f &box, SbVec3f ¢er) override; - -private: - SoSeparator *root, *textSep, *dimSep; - SoCoordinate3 *bboxCoords; - SoIndexedLineSet *bboxLines; -}; - -/** - * This is a special group node which must be defined to ignore bounding box actions. - * @author Werner Mayer - */ -class GuiExport SoSkipBoundingGroup : public SoGroup { - using inherited = SoGroup; - - SO_NODE_HEADER(Gui::SoSkipBoundingGroup); - -public: - static void initClass(); - static void finish(); - SoSkipBoundingGroup(); - - enum Modes { - INCLUDE_BBOX, EXCLUDE_BBOX - }; - - SoSFEnum mode; - - void getBoundingBox(SoGetBoundingBoxAction *action) override; - -protected: - ~SoSkipBoundingGroup() override; -}; - -} // namespace Gui - - -#endif //COIN_SOFCBOUNDINGBOX_H +/*************************************************************************** + * Copyright (c) 2007 Werner Mayer * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#ifndef COIN_SOFCBOUNDINGBOX_H +#define COIN_SOFCBOUNDINGBOX_H + +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace Gui { + +/** + * A subclass of SoShape used to create an axis aligned wire frame box based + * on the minBounds and maxBounds fields. The class also has a field which + * can be toggled on or off for displaying text coordinate labels at the + * vertices of the box. + * @note Original source are taken from http://www.wheatchex.com/projects/openinventor/bbox/BoundingBox.h and + * http://www.wheatchex.com/projects/openinventor/bbox/BoundingBox.cpp + * @date November 12th, 2001 + * @author Josh Grant + */ +class GuiExport SoFCBoundingBox : public SoShape { + using inherited = SoShape; + + SO_NODE_HEADER(Gui::SoFCBoundingBox); + +public: + static void initClass(); + static void finish(); + +public: + SoFCBoundingBox(); + SoSFVec3f minBounds; /**< minimum box coordinates */ + SoSFVec3f maxBounds; /**< maximum box coordinates */ + SoSFBool coordsOn; /**< If true, the coordinates are displayed at each vertex */ + SoSFBool dimensionsOn; /**< If true, the dimensions are displayed in x,y and z direction */ + + +protected: + ~SoFCBoundingBox() override; + void GLRender(SoGLRenderAction *action) override; + void generatePrimitives (SoAction *action) override; + void computeBBox(SoAction *action, SbBox3f &box, SbVec3f ¢er) override; + +private: + SoSeparator *root, *textSep, *dimSep; + SoCoordinate3 *bboxCoords; + SoIndexedLineSet *bboxLines; +}; + +/** + * This is a special group node which must be defined to ignore bounding box actions. + * @author Werner Mayer + */ +class GuiExport SoSkipBoundingGroup : public SoGroup { + using inherited = SoGroup; + + SO_NODE_HEADER(Gui::SoSkipBoundingGroup); + +public: + static void initClass(); + static void finish(); + SoSkipBoundingGroup(); + + enum Modes { + INCLUDE_BBOX, EXCLUDE_BBOX + }; + + SoSFEnum mode; + + void getBoundingBox(SoGetBoundingBoxAction *action) override; + +protected: + ~SoSkipBoundingGroup() override; +}; + +} // namespace Gui + + +#endif //COIN_SOFCBOUNDINGBOX_H diff --git a/src/Gui/SoMouseWheelEvent.cpp b/src/Gui/Inventor/SoMouseWheelEvent.cpp similarity index 100% rename from src/Gui/SoMouseWheelEvent.cpp rename to src/Gui/Inventor/SoMouseWheelEvent.cpp diff --git a/src/Gui/SoMouseWheelEvent.h b/src/Gui/Inventor/SoMouseWheelEvent.h similarity index 100% rename from src/Gui/SoMouseWheelEvent.h rename to src/Gui/Inventor/SoMouseWheelEvent.h diff --git a/src/Gui/InventorNavigationStyle.cpp b/src/Gui/InventorNavigationStyle.cpp index 6eae6323fc..9acf9f6255 100644 --- a/src/Gui/InventorNavigationStyle.cpp +++ b/src/Gui/InventorNavigationStyle.cpp @@ -27,8 +27,8 @@ # include #endif +#include "Inventor/SoMouseWheelEvent.h" #include "NavigationStyle.h" -#include "SoMouseWheelEvent.h" #include "View3DInventorViewer.h" diff --git a/src/Gui/ManualAlignment.cpp b/src/Gui/ManualAlignment.cpp index 0884768a44..270c5f1470 100644 --- a/src/Gui/ManualAlignment.cpp +++ b/src/Gui/ManualAlignment.cpp @@ -47,18 +47,17 @@ #include #include #include +#include #include +#include #include #include #include +#include #include #include #include - #include "ManualAlignment.h" -#include "BitmapFactory.h" -#include "SoAxisCrossKit.h" -#include "Tools.h" using namespace Gui; diff --git a/src/Gui/NavigationStyle.cpp b/src/Gui/NavigationStyle.cpp index bf9ca75d32..24ff54ec4a 100644 --- a/src/Gui/NavigationStyle.cpp +++ b/src/Gui/NavigationStyle.cpp @@ -43,11 +43,11 @@ #include "NavigationStyle.h" #include "Application.h" +#include "Inventor/SoMouseWheelEvent.h" #include "MenuManager.h" #include "MouseSelection.h" #include "NavigationAnimator.h" #include "NavigationAnimation.h" -#include "SoMouseWheelEvent.h" #include "View3DInventorViewer.h" using namespace Gui; diff --git a/src/Gui/Quarter/Mouse.cpp b/src/Gui/Quarter/Mouse.cpp index 66bd3b83e6..1d91f77d95 100644 --- a/src/Gui/Quarter/Mouse.cpp +++ b/src/Gui/Quarter/Mouse.cpp @@ -45,8 +45,8 @@ #include #include -#include #include +#include #include #include diff --git a/src/Gui/SoFCCSysDragger.cpp b/src/Gui/SoFCCSysDragger.cpp index 3ec2c397f0..84d9840f6a 100644 --- a/src/Gui/SoFCCSysDragger.cpp +++ b/src/Gui/SoFCCSysDragger.cpp @@ -51,7 +51,7 @@ #include #include "SoFCCSysDragger.h" -#include "So3DAnnotation.h" +#include "Inventor/So3DAnnotation.h" #include "MainWindow.h" #include "SoFCDB.h" diff --git a/src/Gui/SoFCCSysDragger.h b/src/Gui/SoFCCSysDragger.h index 25fb355be5..20364506b1 100644 --- a/src/Gui/SoFCCSysDragger.h +++ b/src/Gui/SoFCCSysDragger.h @@ -35,8 +35,6 @@ #include #include -#include "So3DAnnotation.h" - class SoCamera; namespace Gui diff --git a/src/Gui/SoFCDB.cpp b/src/Gui/SoFCDB.cpp index ec58e5ffd4..66f3ec633b 100644 --- a/src/Gui/SoFCDB.cpp +++ b/src/Gui/SoFCDB.cpp @@ -53,10 +53,7 @@ #include "GestureNavigationStyle.h" #include "NavigationStyle.h" #include "SelectionObject.h" -#include "So3DAnnotation.h" -#include "SoAxisCrossKit.h" #include "SoFCBackgroundGradient.h" -#include "SoFCBoundingBox.h" #include "SoFCColorBar.h" #include "SoFCColorGradient.h" #include "SoFCColorLegend.h" @@ -67,13 +64,16 @@ #include "SoFCUnifiedSelection.h" #include "SoFCVectorizeSVGAction.h" #include "SoFCVectorizeU3DAction.h" -#include "SoMouseWheelEvent.h" #include "SoTextLabel.h" #include "SoDatumLabel.h" #include "Inventor/MarkerBitmaps.h" #include "Inventor/SmSwitchboard.h" +#include "Inventor/So3DAnnotation.h" #include "Inventor/SoAutoZoomTranslation.h" +#include "Inventor/SoAxisCrossKit.h" #include "Inventor/SoDrawingGrid.h" +#include "Inventor/SoFCBoundingBox.h" +#include "Inventor/SoMouseWheelEvent.h" #include "propertyeditor/PropertyItem.h" #include "ArcEngine.h" diff --git a/src/Gui/View3DInventorViewer.cpp b/src/Gui/View3DInventorViewer.cpp index d168c25f55..94af3716cb 100644 --- a/src/Gui/View3DInventorViewer.cpp +++ b/src/Gui/View3DInventorViewer.cpp @@ -94,14 +94,14 @@ #include "Application.h" #include "Document.h" #include "GLPainter.h" +#include "Inventor/SoAxisCrossKit.h" +#include "Inventor/SoFCBoundingBox.h" #include "MainWindow.h" #include "Multisample.h" #include "NaviCube.h" #include "NavigationStyle.h" #include "Selection.h" -#include "SoAxisCrossKit.h" #include "SoFCBackgroundGradient.h" -#include "SoFCBoundingBox.h" #include "SoFCDB.h" #include "SoFCInteractiveElement.h" #include "SoFCOffscreenRenderer.h" diff --git a/src/Gui/View3DPy.cpp b/src/Gui/View3DPy.cpp index f6113588f1..3d9e6e6a60 100644 --- a/src/Gui/View3DPy.cpp +++ b/src/Gui/View3DPy.cpp @@ -55,6 +55,7 @@ #include "Camera.h" #include "Document.h" +#include "Inventor/SoMouseWheelEvent.h" #include "NavigationStyle.h" #include "PythonWrapper.h" #include "SoFCDB.h" @@ -62,7 +63,6 @@ #include "SoFCSelectionAction.h" #include "SoFCVectorizeSVGAction.h" #include "SoFCVectorizeU3DAction.h" -#include "SoMouseWheelEvent.h" #include "View3DInventor.h" #include "View3DInventorViewer.h" #include "ViewProviderDocumentObject.h" diff --git a/src/Gui/ViewProvider.cpp b/src/Gui/ViewProvider.cpp index 143a85bff6..fdd63583be 100644 --- a/src/Gui/ViewProvider.cpp +++ b/src/Gui/ViewProvider.cpp @@ -41,7 +41,7 @@ #include #include -#include "SoMouseWheelEvent.h" +#include "Inventor/SoMouseWheelEvent.h" #include "ViewProvider.h" #include "ActionFunction.h" #include "Application.h" diff --git a/src/Gui/ViewProviderGeometryObject.cpp b/src/Gui/ViewProviderGeometryObject.cpp index d7c1754c15..5e45d86d62 100644 --- a/src/Gui/ViewProviderGeometryObject.cpp +++ b/src/Gui/ViewProviderGeometryObject.cpp @@ -32,18 +32,17 @@ #include #include #include +#include #include #include #endif -#include - #include #include #include "Application.h" #include "Document.h" -#include "SoFCBoundingBox.h" +#include "Inventor/SoFCBoundingBox.h" #include "SoFCSelection.h" #include "View3DInventorViewer.h" #include "ViewProviderGeometryObject.h" diff --git a/src/Mod/CAM/Gui/ViewProviderPath.cpp b/src/Mod/CAM/Gui/ViewProviderPath.cpp index 0be6dd03af..e96b71f02f 100644 --- a/src/Mod/CAM/Gui/ViewProviderPath.cpp +++ b/src/Mod/CAM/Gui/ViewProviderPath.cpp @@ -44,8 +44,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/src/Mod/Part/Gui/ViewProvider2DObject.cpp b/src/Mod/Part/Gui/ViewProvider2DObject.cpp index dfde26fa89..b9a2d96dfc 100644 --- a/src/Mod/Part/Gui/ViewProvider2DObject.cpp +++ b/src/Mod/Part/Gui/ViewProvider2DObject.cpp @@ -41,7 +41,7 @@ #include #include #include -#include +#include #include "ViewProvider2DObject.h" diff --git a/src/Mod/Part/Gui/ViewProviderGridExtension.cpp b/src/Mod/Part/Gui/ViewProviderGridExtension.cpp index 561503ced7..9b6130c7b6 100644 --- a/src/Mod/Part/Gui/ViewProviderGridExtension.cpp +++ b/src/Mod/Part/Gui/ViewProviderGridExtension.cpp @@ -50,7 +50,7 @@ #include #include -#include +#include #include "ViewProviderGridExtension.h" diff --git a/src/Mod/Sketcher/Gui/EditModeCoinManager.cpp b/src/Mod/Sketcher/Gui/EditModeCoinManager.cpp index abdacaae76..e29026c9dd 100644 --- a/src/Mod/Sketcher/Gui/EditModeCoinManager.cpp +++ b/src/Mod/Sketcher/Gui/EditModeCoinManager.cpp @@ -44,7 +44,7 @@ #include #include -#include +#include #include #include From a48138643637dbd765457a8b59b716bcf8868105 Mon Sep 17 00:00:00 2001 From: liukaiwen Date: Mon, 22 Jul 2024 02:48:53 +0800 Subject: [PATCH 2/2] add SoFCBackgroundGradient to inventor folder --- src/Gui/CMakeLists.txt | 16 ++++++++-------- .../{ => Inventor}/SoFCBackgroundGradient.cpp | 0 src/Gui/{ => Inventor}/SoFCBackgroundGradient.h | 0 src/Gui/SoFCDB.cpp | 2 +- src/Gui/View3DInventorViewer.cpp | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) rename src/Gui/{ => Inventor}/SoFCBackgroundGradient.cpp (100%) rename src/Gui/{ => Inventor}/SoFCBackgroundGradient.h (100%) diff --git a/src/Gui/CMakeLists.txt b/src/Gui/CMakeLists.txt index e4b7b7483a..9dd92cda9a 100644 --- a/src/Gui/CMakeLists.txt +++ b/src/Gui/CMakeLists.txt @@ -1005,15 +1005,15 @@ SOURCE_GROUP("View3D\\Viewprovider" FILES ${Viewprovider_SRCS}) # The Inventor sources SET(Inventor_CPP_SRCS - Inventor/SoDrawingGrid.cpp - Inventor/SoAutoZoomTranslation.cpp Inventor/MarkerBitmaps.cpp Inventor/SmSwitchboard.cpp - Inventor/SoFCBoundingBox.cpp Inventor/So3DAnnotation.cpp + Inventor/SoAutoZoomTranslation.cpp Inventor/SoAxisCrossKit.cpp + Inventor/SoDrawingGrid.cpp + Inventor/SoFCBackgroundGradient.cpp + Inventor/SoFCBoundingBox.cpp Inventor/SoMouseWheelEvent.cpp - SoFCBackgroundGradient.cpp SoFCColorBar.cpp SoFCColorBarNotifier.cpp SoFCColorGradient.cpp @@ -1036,14 +1036,14 @@ SET(Inventor_CPP_SRCS ) SET(Inventor_SRCS ${Inventor_CPP_SRCS} - Inventor/SoDrawingGrid.h - Inventor/SoAutoZoomTranslation.h Inventor/MarkerBitmaps.h Inventor/SmSwitchboard.h - Inventor/SoFCBoundingBox.h + Inventor/SoAutoZoomTranslation.h Inventor/SoAxisCrossKit.h + Inventor/SoDrawingGrid.h + Inventor/SoFCBackgroundGradient.h + Inventor/SoFCBoundingBox.h Inventor/SoMouseWheelEvent.h - SoFCBackgroundGradient.h SoFCColorBar.h SoFCColorBarNotifier.h SoFCColorGradient.h diff --git a/src/Gui/SoFCBackgroundGradient.cpp b/src/Gui/Inventor/SoFCBackgroundGradient.cpp similarity index 100% rename from src/Gui/SoFCBackgroundGradient.cpp rename to src/Gui/Inventor/SoFCBackgroundGradient.cpp diff --git a/src/Gui/SoFCBackgroundGradient.h b/src/Gui/Inventor/SoFCBackgroundGradient.h similarity index 100% rename from src/Gui/SoFCBackgroundGradient.h rename to src/Gui/Inventor/SoFCBackgroundGradient.h diff --git a/src/Gui/SoFCDB.cpp b/src/Gui/SoFCDB.cpp index 66f3ec633b..26b17df172 100644 --- a/src/Gui/SoFCDB.cpp +++ b/src/Gui/SoFCDB.cpp @@ -53,7 +53,6 @@ #include "GestureNavigationStyle.h" #include "NavigationStyle.h" #include "SelectionObject.h" -#include "SoFCBackgroundGradient.h" #include "SoFCColorBar.h" #include "SoFCColorGradient.h" #include "SoFCColorLegend.h" @@ -72,6 +71,7 @@ #include "Inventor/SoAutoZoomTranslation.h" #include "Inventor/SoAxisCrossKit.h" #include "Inventor/SoDrawingGrid.h" +#include "Inventor/SoFCBackgroundGradient.h" #include "Inventor/SoFCBoundingBox.h" #include "Inventor/SoMouseWheelEvent.h" #include "propertyeditor/PropertyItem.h" diff --git a/src/Gui/View3DInventorViewer.cpp b/src/Gui/View3DInventorViewer.cpp index 94af3716cb..eea95ef090 100644 --- a/src/Gui/View3DInventorViewer.cpp +++ b/src/Gui/View3DInventorViewer.cpp @@ -95,13 +95,13 @@ #include "Document.h" #include "GLPainter.h" #include "Inventor/SoAxisCrossKit.h" +#include "Inventor/SoFCBackgroundGradient.h" #include "Inventor/SoFCBoundingBox.h" #include "MainWindow.h" #include "Multisample.h" #include "NaviCube.h" #include "NavigationStyle.h" #include "Selection.h" -#include "SoFCBackgroundGradient.h" #include "SoFCDB.h" #include "SoFCInteractiveElement.h" #include "SoFCOffscreenRenderer.h"