+ fix author notes, fix memory leak, fix build failure under Windows
This commit is contained in:
parent
6ca580456b
commit
a252471625
|
@ -45,6 +45,7 @@
|
||||||
#include <Inventor/SbViewportRegion.h>
|
#include <Inventor/SbViewportRegion.h>
|
||||||
#include <Inventor/actions/SoBoxHighlightRenderAction.h>
|
#include <Inventor/actions/SoBoxHighlightRenderAction.h>
|
||||||
#include <Inventor/actions/SoGetBoundingBoxAction.h>
|
#include <Inventor/actions/SoGetBoundingBoxAction.h>
|
||||||
|
#include <Inventor/actions/SoGetMatrixAction.h>
|
||||||
#include <Inventor/actions/SoGetPrimitiveCountAction.h>
|
#include <Inventor/actions/SoGetPrimitiveCountAction.h>
|
||||||
#include <Inventor/actions/SoGLRenderAction.h>
|
#include <Inventor/actions/SoGLRenderAction.h>
|
||||||
#include <Inventor/actions/SoHandleEventAction.h>
|
#include <Inventor/actions/SoHandleEventAction.h>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (c) 2002 J<EFBFBD>rgen Riegel <juergen.riegel@web.de> *
|
* Copyright (c) 2002 Juergen Riegel <juergen.riegel@web.de> *
|
||||||
* *
|
* *
|
||||||
* This file is part of the FreeCAD CAx development system. *
|
* This file is part of the FreeCAD CAx development system. *
|
||||||
* *
|
* *
|
||||||
|
@ -53,7 +53,7 @@ using namespace Gui::PropertyEditor;
|
||||||
/* TRANSLATOR Gui::PropertyView */
|
/* TRANSLATOR Gui::PropertyView */
|
||||||
|
|
||||||
/*! Property Editor Widget
|
/*! Property Editor Widget
|
||||||
*
|
*
|
||||||
* Provides two Gui::PropertyEditor::PropertyEditor widgets, for "View" and "Data",
|
* Provides two Gui::PropertyEditor::PropertyEditor widgets, for "View" and "Data",
|
||||||
* in two tabs.
|
* in two tabs.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (c) 2004 J<EFBFBD>rgen Riegel <juergen.riegel@web.de> *
|
* Copyright (c) 2004 Juergen Riegel <juergen.riegel@web.de> *
|
||||||
* *
|
* *
|
||||||
* This file is part of the FreeCAD CAx development system. *
|
* This file is part of the FreeCAD CAx development system. *
|
||||||
* *
|
* *
|
||||||
|
@ -58,7 +58,7 @@ protected:
|
||||||
|
|
||||||
/** The 3D view window
|
/** The 3D view window
|
||||||
* It consists out of the 3D view
|
* It consists out of the 3D view
|
||||||
* \author J<EFBFBD>rgen Riegel
|
* \author Juergen Riegel
|
||||||
*/
|
*/
|
||||||
class GuiExport View3DInventor : public MDIView, public ParameterGrp::ObserverType
|
class GuiExport View3DInventor : public MDIView, public ParameterGrp::ObserverType
|
||||||
{
|
{
|
||||||
|
|
|
@ -742,15 +742,14 @@ const std::vector<SbVec2s>& View3DInventorViewer::getPolygon(SbBool* clip_inner)
|
||||||
SbVec2f View3DInventorViewer::screenCoordsOfPath(SoPath *path) const
|
SbVec2f View3DInventorViewer::screenCoordsOfPath(SoPath *path) const
|
||||||
{
|
{
|
||||||
// Generate a matrix (well, a SoGetMatrixAction) that
|
// Generate a matrix (well, a SoGetMatrixAction) that
|
||||||
// moves us us to the picked object's coordinate space.
|
// moves us to the picked object's coordinate space.
|
||||||
SoGetMatrixAction *gma;
|
SoGetMatrixAction gma(getViewportRegion());
|
||||||
gma = new SoGetMatrixAction(getViewportRegion());
|
gma.apply(path);
|
||||||
gma->apply(path);
|
|
||||||
|
|
||||||
// Use that matrix to translate the origin in the picked
|
// Use that matrix to translate the origin in the picked
|
||||||
// object's coordinate space into object space
|
// object's coordinate space into object space
|
||||||
SbVec3f imageCoords(0, 0, 0);
|
SbVec3f imageCoords(0, 0, 0);
|
||||||
SbMatrix m = gma->getMatrix().transpose();
|
SbMatrix m = gma.getMatrix().transpose();
|
||||||
m.multMatrixVec(imageCoords, imageCoords);
|
m.multMatrixVec(imageCoords, imageCoords);
|
||||||
|
|
||||||
// Now, project the object space coordinates of the object
|
// Now, project the object space coordinates of the object
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (c) 2004 J<EFBFBD>rgen Riegel <juergen.riegel@web.de> *
|
* Copyright (c) 2004 Juergen Riegel <juergen.riegel@web.de> *
|
||||||
* *
|
* *
|
||||||
* This file is part of the FreeCAD CAx development system. *
|
* This file is part of the FreeCAD CAx development system. *
|
||||||
* *
|
* *
|
||||||
|
@ -61,7 +61,7 @@ class SoFCUnifiedSelection;
|
||||||
class GLGraphicsItem;
|
class GLGraphicsItem;
|
||||||
class SoShapeScale;
|
class SoShapeScale;
|
||||||
|
|
||||||
/** GUI view into a 3-D Scene provided by View3DInventor
|
/** GUI view into a 3D scene provided by View3DInventor
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class GuiExport View3DInventorViewer : public SoQtViewer, public Gui::SelectionSingleton::ObserverType
|
class GuiExport View3DInventorViewer : public SoQtViewer, public Gui::SelectionSingleton::ObserverType
|
||||||
|
@ -127,10 +127,6 @@ public:
|
||||||
SbBool isBacklight(void) const;
|
SbBool isBacklight(void) const;
|
||||||
void setSceneGraph (SoNode *root);
|
void setSceneGraph (SoNode *root);
|
||||||
|
|
||||||
// TODO: I think it might be cleaner to move this functionality into a
|
|
||||||
// different class, with this class supporting something like a
|
|
||||||
// rotate() slot that gets triggered by the new Animator class?
|
|
||||||
// IR 20140630
|
|
||||||
void setAnimationEnabled(const SbBool enable);
|
void setAnimationEnabled(const SbBool enable);
|
||||||
SbBool isAnimationEnabled(void) const;
|
SbBool isAnimationEnabled(void) const;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (c) 2009 J<EFBFBD>rgen Riegel <juergen.riegel@web.de> *
|
* Copyright (c) 2009 Juergen Riegel <juergen.riegel@web.de> *
|
||||||
* *
|
* *
|
||||||
* This file is part of the FreeCAD CAx development system. *
|
* This file is part of the FreeCAD CAx development system. *
|
||||||
* *
|
* *
|
||||||
|
@ -2038,7 +2038,6 @@ void ViewProviderSketch::clearCoinImage(SoImage *soImagePtr)
|
||||||
soImagePtr->setToDefaults();
|
soImagePtr->setToDefaults();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QColor ViewProviderSketch::constrColor(int constraintId)
|
QColor ViewProviderSketch::constrColor(int constraintId)
|
||||||
{
|
{
|
||||||
static QColor constrIcoColor((int)(ConstrIcoColor [0] * 255.0f),
|
static QColor constrIcoColor((int)(ConstrIcoColor [0] * 255.0f),
|
||||||
|
@ -2058,7 +2057,7 @@ QColor ViewProviderSketch::constrColor(int constraintId)
|
||||||
else
|
else
|
||||||
return constrIcoColor;
|
return constrIcoColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ViewProviderSketch::constrColorPriority(int constraintId)
|
int ViewProviderSketch::constrColorPriority(int constraintId)
|
||||||
{
|
{
|
||||||
if (edit->PreselectConstraintSet.count(constraintId))
|
if (edit->PreselectConstraintSet.count(constraintId))
|
||||||
|
@ -2116,7 +2115,7 @@ void ViewProviderSketch::drawConstraintIcons()
|
||||||
|
|
||||||
// Find the Constraint Icon SoImage Node
|
// Find the Constraint Icon SoImage Node
|
||||||
SoSeparator *sep = static_cast<SoSeparator *>(edit->constrGroup->getChild(constrId));
|
SoSeparator *sep = static_cast<SoSeparator *>(edit->constrGroup->getChild(constrId));
|
||||||
|
|
||||||
SbVec3f absPos;
|
SbVec3f absPos;
|
||||||
// Somewhat hacky - we use SoZoomTranslations for most types of icon,
|
// Somewhat hacky - we use SoZoomTranslations for most types of icon,
|
||||||
// but symmetry icons use SoTranslations...
|
// but symmetry icons use SoTranslations...
|
||||||
|
@ -2125,7 +2124,7 @@ void ViewProviderSketch::drawConstraintIcons()
|
||||||
absPos = static_cast<SoZoomTranslation *>(translationPtr)->abPos.getValue();
|
absPos = static_cast<SoZoomTranslation *>(translationPtr)->abPos.getValue();
|
||||||
else
|
else
|
||||||
absPos = translationPtr->translation.getValue();
|
absPos = translationPtr->translation.getValue();
|
||||||
|
|
||||||
SoImage *coinIconPtr = dynamic_cast<SoImage *>(sep->getChild(CONSTRAINT_SEPARATOR_INDEX_FIRST_ICON));
|
SoImage *coinIconPtr = dynamic_cast<SoImage *>(sep->getChild(CONSTRAINT_SEPARATOR_INDEX_FIRST_ICON));
|
||||||
SoInfo *infoPtr = static_cast<SoInfo *>(sep->getChild(CONSTRAINT_SEPARATOR_INDEX_FIRST_CONSTRAINTID));
|
SoInfo *infoPtr = static_cast<SoInfo *>(sep->getChild(CONSTRAINT_SEPARATOR_INDEX_FIRST_CONSTRAINTID));
|
||||||
|
|
||||||
|
@ -2165,7 +2164,7 @@ void ViewProviderSketch::drawConstraintIcons()
|
||||||
|
|
||||||
iconQueue.push_back(thisIcon);
|
iconQueue.push_back(thisIcon);
|
||||||
}
|
}
|
||||||
|
|
||||||
combineConstraintIcons(iconQueue);
|
combineConstraintIcons(iconQueue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2297,7 +2296,7 @@ void ViewProviderSketch::drawMergedConstraintIcons(IconQueue iconQueue)
|
||||||
|
|
||||||
i = iconQueue.erase(i);
|
i = iconQueue.erase(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
// To be inserted into edit->combinedConstBoxes
|
// To be inserted into edit->combinedConstBoxes
|
||||||
std::vector<QRect> boundingBoxesVec;
|
std::vector<QRect> boundingBoxesVec;
|
||||||
int oldHeight = 0;
|
int oldHeight = 0;
|
||||||
|
@ -2390,7 +2389,7 @@ QImage ViewProviderSketch::renderConstrIcon(const QString &type,
|
||||||
QString joinStr = QString::fromAscii(", ");
|
QString joinStr = QString::fromAscii(", ");
|
||||||
|
|
||||||
QImage icon = Gui::BitmapFactory().pixmap(type.toAscii()).toImage();
|
QImage icon = Gui::BitmapFactory().pixmap(type.toAscii()).toImage();
|
||||||
|
|
||||||
QFont font = QApplication::font();
|
QFont font = QApplication::font();
|
||||||
font.setPixelSize(11);
|
font.setPixelSize(11);
|
||||||
font.setBold(true);
|
font.setBold(true);
|
||||||
|
@ -2432,7 +2431,7 @@ QImage ViewProviderSketch::renderConstrIcon(const QString &type,
|
||||||
++labelItr, ++colorItr) {
|
++labelItr, ++colorItr) {
|
||||||
|
|
||||||
qp.setPen(*colorItr);
|
qp.setPen(*colorItr);
|
||||||
|
|
||||||
if(labelItr + 1 == labels.end()) // if this is the last label
|
if(labelItr + 1 == labels.end()) // if this is the last label
|
||||||
labelStr = *labelItr;
|
labelStr = *labelItr;
|
||||||
else
|
else
|
||||||
|
@ -2450,7 +2449,7 @@ QImage ViewProviderSketch::renderConstrIcon(const QString &type,
|
||||||
icon.height() - qfm.height() + pxBelowBase);
|
icon.height() - qfm.height() + pxBelowBase);
|
||||||
boundingBoxes->push_back(labelBB);
|
boundingBoxes->push_back(labelBB);
|
||||||
}
|
}
|
||||||
|
|
||||||
cursorOffset += qfm.width(labelStr);
|
cursorOffset += qfm.width(labelStr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3336,15 +3335,15 @@ void ViewProviderSketch::rebuildConstraintsVisual(void)
|
||||||
// #define CONSTRAINT_SEPARATOR_INDEX_MATERIAL_OR_DATUMLABEL 0
|
// #define CONSTRAINT_SEPARATOR_INDEX_MATERIAL_OR_DATUMLABEL 0
|
||||||
sep->addChild(mat);
|
sep->addChild(mat);
|
||||||
// #define CONSTRAINT_SEPARATOR_INDEX_FIRST_TRANSLATION 1
|
// #define CONSTRAINT_SEPARATOR_INDEX_FIRST_TRANSLATION 1
|
||||||
sep->addChild(new SoZoomTranslation());
|
sep->addChild(new SoZoomTranslation());
|
||||||
// #define CONSTRAINT_SEPARATOR_INDEX_FIRST_ICON 2
|
// #define CONSTRAINT_SEPARATOR_INDEX_FIRST_ICON 2
|
||||||
sep->addChild(new SoImage());
|
sep->addChild(new SoImage());
|
||||||
// #define CONSTRAINT_SEPARATOR_INDEX_FIRST_CONSTRAINTID 3
|
// #define CONSTRAINT_SEPARATOR_INDEX_FIRST_CONSTRAINTID 3
|
||||||
sep->addChild(new SoInfo());
|
sep->addChild(new SoInfo());
|
||||||
// #define CONSTRAINT_SEPARATOR_INDEX_SECOND_TRANSLATION 4
|
// #define CONSTRAINT_SEPARATOR_INDEX_SECOND_TRANSLATION 4
|
||||||
sep->addChild(new SoZoomTranslation());
|
sep->addChild(new SoZoomTranslation());
|
||||||
// #define CONSTRAINT_SEPARATOR_INDEX_SECOND_ICON 5
|
// #define CONSTRAINT_SEPARATOR_INDEX_SECOND_ICON 5
|
||||||
sep->addChild(new SoImage());
|
sep->addChild(new SoImage());
|
||||||
// #define CONSTRAINT_SEPARATOR_INDEX_SECOND_CONSTRAINTID 6
|
// #define CONSTRAINT_SEPARATOR_INDEX_SECOND_CONSTRAINTID 6
|
||||||
sep->addChild(new SoInfo());
|
sep->addChild(new SoInfo());
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (c) 2009 J<EFBFBD>rgen Riegel <juergen.riegel@web.de> *
|
* Copyright (c) 2009 Juergen Riegel <juergen.riegel@web.de> *
|
||||||
* *
|
* *
|
||||||
* This file is part of the FreeCAD CAx development system. *
|
* This file is part of the FreeCAD CAx development system. *
|
||||||
* *
|
* *
|
||||||
|
|
Loading…
Reference in New Issue
Block a user