Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenFlipper-Free
OpenFlipper-Free
Commits
4629ca45
Commit
4629ca45
authored
May 02, 2016
by
Jan Möbius
3
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made all update calls of the object types private.
Only type plugins and the core will access the update function
parent
e4bef69e
Pipeline
#1574
passed with stage
Changes
20
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
290 additions
and
44 deletions
+290
-44
ObjectTypes/BSplineCurve/BSplineCurveObject.hh
ObjectTypes/BSplineCurve/BSplineCurveObject.hh
+17
-3
ObjectTypes/BSplineSurface/BSplineSurfaceObject.hh
ObjectTypes/BSplineSurface/BSplineSurfaceObject.hh
+15
-3
ObjectTypes/Camera/CameraObject.cc
ObjectTypes/Camera/CameraObject.cc
+10
-0
ObjectTypes/Camera/CameraObject.hh
ObjectTypes/Camera/CameraObject.hh
+17
-0
ObjectTypes/Coordsys/CoordsysObject.cc
ObjectTypes/Coordsys/CoordsysObject.cc
+10
-0
ObjectTypes/Coordsys/CoordsysObject.hh
ObjectTypes/Coordsys/CoordsysObject.hh
+18
-0
ObjectTypes/Light/LightObject.cc
ObjectTypes/Light/LightObject.cc
+0
-1
ObjectTypes/Light/LightObject.hh
ObjectTypes/Light/LightObject.hh
+23
-6
ObjectTypes/Plane/PlaneObject.hh
ObjectTypes/Plane/PlaneObject.hh
+10
-2
ObjectTypes/PolyLine/PolyLineObject.hh
ObjectTypes/PolyLine/PolyLineObject.hh
+19
-3
ObjectTypes/QtWidget/QtWidgetObject.cc
ObjectTypes/QtWidget/QtWidgetObject.cc
+9
-0
ObjectTypes/QtWidget/QtWidgetObject.hh
ObjectTypes/QtWidget/QtWidgetObject.hh
+24
-0
ObjectTypes/Skeleton/SkeletonObject.cc
ObjectTypes/Skeleton/SkeletonObject.cc
+9
-0
ObjectTypes/Skeleton/SkeletonObject.hh
ObjectTypes/Skeleton/SkeletonObject.hh
+25
-0
ObjectTypes/Sphere/SphereObject.cc
ObjectTypes/Sphere/SphereObject.cc
+8
-0
ObjectTypes/Sphere/SphereObject.hh
ObjectTypes/Sphere/SphereObject.hh
+19
-0
ObjectTypes/SplatCloud/SplatCloudObject.hh
ObjectTypes/SplatCloud/SplatCloudObject.hh
+15
-1
ObjectTypes/VolumeMeshObject/VolumeMeshObject.hh
ObjectTypes/VolumeMeshObject/VolumeMeshObject.hh
+33
-18
OpenFlipper/common/BaseObjectData.hh
OpenFlipper/common/BaseObjectData.hh
+6
-3
Plugin-HoleFilling/HoleFillerPlugin.cc
Plugin-HoleFilling/HoleFillerPlugin.cc
+3
-4
No files found.
ObjectTypes/BSplineCurve/BSplineCurveObject.hh
View file @
4629ca45
...
...
@@ -83,6 +83,8 @@
*/
class
DLLEXPORT
BSplineCurveObject
:
public
BaseObjectData
{
friend
class
TypeBSplineCurvePlugin
;
public:
/// constructor
BSplineCurveObject
();
...
...
@@ -126,13 +128,25 @@ class DLLEXPORT BSplineCurveObject : public BaseObjectData {
public:
/// return a pointer to the spline curve
BSplineCurve
*
splineCurve
();
/// Update the whole Object (Selection,Topology,...)
virtual
void
update
(
UpdateType
_type
=
UPDATE_ALL
);
private:
BSplineCurve
*
splineCurve_
;
/** @} */
//===========================================================================
/** @name Update handling
*
* This is mostly private. Updates have to be triggered via
* emit updatedObject()
*
* @{ */
//===========================================================================
private:
/// Update the whole Object (Selection,Topology,...)
virtual
void
update
(
UpdateType
_type
=
UPDATE_ALL
);
/** @} */
...
...
ObjectTypes/BSplineSurface/BSplineSurfaceObject.hh
View file @
4629ca45
...
...
@@ -85,6 +85,8 @@
*/
class
DLLEXPORT
BSplineSurfaceObject
:
public
BaseObjectData
{
friend
class
TypeBSplineSurfacePlugin
;
public:
/// Constructor
...
...
@@ -130,12 +132,22 @@ class DLLEXPORT BSplineSurfaceObject : public BaseObjectData {
/// return a pointer to the spline curve
BSplineSurface
*
splineSurface
();
/// Update the whole Object (Selection,Topology,...)
virtual
void
update
(
UpdateType
_type
=
UPDATE_ALL
);
private:
BSplineSurface
*
splineSurface_
;
//===========================================================================
/** @name Update handling
*
* This is mostly private. Updates have to be triggered via
* emit updatedObject()
*
* @{ */
//===========================================================================
private:
/// Update the whole Object (Selection,Topology,...)
virtual
void
update
(
UpdateType
_type
=
UPDATE_ALL
);
/** @} */
//===========================================================================
...
...
ObjectTypes/Camera/CameraObject.cc
View file @
4629ca45
...
...
@@ -230,5 +230,15 @@ bool CameraObject::pickingEnabled() {
return
cameraNode_
->
pickingEnabled
();
}
// ===============================================================================
// Update
// ===============================================================================
void
CameraObject
::
update
(
UpdateType
_type
)
{
BaseObject
::
update
(
_type
);
}
//=============================================================================
ObjectTypes/Camera/CameraObject.hh
View file @
4629ca45
...
...
@@ -81,6 +81,8 @@
class
DLLEXPORT
CameraObject
:
public
BaseObjectData
{
friend
class
TypeCameraPlugin
;
public:
/// constructor
CameraObject
(
);
...
...
@@ -174,6 +176,21 @@ class DLLEXPORT CameraObject : public BaseObjectData {
/// Attached examiner id
int
examinerId_
;
//===========================================================================
/** @name Update handling
*
* This is mostly private. Updates have to be triggered via
* emit updatedObject()
*
* @{ */
//===========================================================================
private:
/// Update the whole Object (Selection,Topology,...)
virtual
void
update
(
UpdateType
_type
=
UPDATE_ALL
);
/** @} */
};
//=============================================================================
...
...
ObjectTypes/Coordsys/CoordsysObject.cc
View file @
4629ca45
...
...
@@ -225,5 +225,15 @@ bool CoordsysObject::pickingEnabled() {
return
coordsysNode_
->
pickingEnabled
();
}
// ===============================================================================
// Update
// ===============================================================================
void
CoordsysObject
::
update
(
UpdateType
_type
)
{
BaseObject
::
update
(
_type
);
}
//=============================================================================
ObjectTypes/Coordsys/CoordsysObject.hh
View file @
4629ca45
...
...
@@ -78,6 +78,8 @@
class
DLLEXPORT
CoordsysObject
:
public
BaseObjectData
{
friend
class
TypeCoordsysPlugin
;
public:
/// constructor
CoordsysObject
();
...
...
@@ -154,6 +156,22 @@ class DLLEXPORT CoordsysObject : public BaseObjectData {
/** @} */
//===========================================================================
/** @name Update handling
*
* This is mostly private. Updates have to be triggered via
* emit updatedObject()
*
* @{ */
//===========================================================================
private:
/// Update the whole Object (Selection,Topology,...)
virtual
void
update
(
UpdateType
_type
=
UPDATE_ALL
);
/** @} */
};
//=============================================================================
...
...
ObjectTypes/Light/LightObject.cc
View file @
4629ca45
...
...
@@ -343,6 +343,5 @@ void LightObject::update(UpdateType _type) {
lightNodeVis_
->
setLightSource
(
lightSource_
);
}
//=============================================================================
ObjectTypes/Light/LightObject.hh
View file @
4629ca45
...
...
@@ -77,6 +77,9 @@
class
DLLEXPORT
LightObject
:
public
BaseObjectData
{
friend
class
TypeLightPlugin
;
friend
class
LightWidget
;
public:
/// constructor
LightObject
();
...
...
@@ -122,12 +125,7 @@ class DLLEXPORT LightObject : public BaseObjectData {
LightSource
*
lightSource
();
/** \brief Update the Light Object
*
* Updates the rendering of the light object
*/
virtual
void
update
(
UpdateType
_type
=
UPDATE_ALL
);
/// Is light default light source?
bool
defaultLight
()
const
{
return
defaultLightSource_
;
}
...
...
@@ -141,6 +139,24 @@ class DLLEXPORT LightObject : public BaseObjectData {
/// added to a blank scene
bool
defaultLightSource_
;
/** @} */
//===========================================================================
/** @name Update handling
*
* This is mostly private. Updates have to be triggered via
* emit updatedObject()
*
* @{ */
//===========================================================================
private:
/** \brief Update the Light Object
*
* Updates the rendering of the light object
*/
virtual
void
update
(
UpdateType
_type
=
UPDATE_ALL
);
/** @} */
//===========================================================================
...
...
@@ -207,6 +223,7 @@ class DLLEXPORT LightObject : public BaseObjectData {
/// Hide Light Node
virtual
void
hide
();
};
//=============================================================================
...
...
ObjectTypes/Plane/PlaneObject.hh
View file @
4629ca45
...
...
@@ -78,6 +78,8 @@
class
DLLEXPORT
PlaneObject
:
public
BaseObjectData
{
friend
class
TypePlanePlugin
;
public:
/// constructor
PlaneObject
();
...
...
@@ -127,11 +129,15 @@ class DLLEXPORT PlaneObject : public BaseObjectData {
/** @} */
//===========================================================================
/** @name Content
/** @name Update handling
*
* This is mostly private. Updates have to be triggered via
* emit updatedObject()
*
* @{ */
//===========================================================================
p
ublic
:
p
rivate
:
/** \brief This function is called to update the object
*
* If the object changes, the core will call this function. This function
...
...
@@ -140,6 +146,8 @@ class DLLEXPORT PlaneObject : public BaseObjectData {
* \note Do not call this function yourself to avoid unnecessary overhead(the core will call it when it is required)
*/
void
update
(
UpdateType
_type
=
UPDATE_ALL
);
/** @} */
//===========================================================================
/** @name Visualization
...
...
ObjectTypes/PolyLine/PolyLineObject.hh
View file @
4629ca45
...
...
@@ -80,6 +80,9 @@
/** This class provides the functionality for all kind of meshes for the framework
*/
class
DLLEXPORT
PolyLineObject
:
public
BaseObjectData
{
friend
class
TypePolyLinePlugin
;
public:
typedef
PolyLine
PolyLineType
;
...
...
@@ -129,6 +132,22 @@ class DLLEXPORT PolyLineObject : public BaseObjectData {
/// return a pointer to the line
PolyLine
*
line
();
private:
/// Pointer to the polyline
PolyLine
*
line_
;
/** @} */
//===========================================================================
/** @name Update handling
*
* This is mostly private. Updates have to be triggered via
* emit updatedObject()
*
* @{ */
//===========================================================================
private:
/** \brief This function is called to update the object
*
* If the object changes, the core will call this function. Normally this will update
...
...
@@ -138,9 +157,6 @@ class DLLEXPORT PolyLineObject : public BaseObjectData {
* \note Do not call this function yourself to avoid unnecessary overhead(the core will call it when it is required)
*/
virtual
void
update
(
UpdateType
_type
=
UPDATE_ALL
);
private:
PolyLine
*
line_
;
/** @} */
...
...
ObjectTypes/QtWidget/QtWidgetObject.cc
View file @
4629ca45
...
...
@@ -249,5 +249,14 @@ bool QtWidgetObject::visible() {
}
// ===============================================================================
// Update
// ===============================================================================
void
QtWidgetObject
::
update
(
UpdateType
_type
)
{
BaseObject
::
update
(
_type
);
}
//=============================================================================
ObjectTypes/QtWidget/QtWidgetObject.hh
View file @
4629ca45
...
...
@@ -77,6 +77,8 @@
class
DLLEXPORT
QtWidgetObject
:
public
BaseObjectData
{
friend
class
TypeQtWidgetPlugin
;
public:
/// constructor
QtWidgetObject
();
...
...
@@ -186,6 +188,28 @@ class DLLEXPORT QtWidgetObject : public BaseObjectData {
/// Hide Node
virtual
void
hide
();
//===========================================================================
/** @name Update handling
*
* This is mostly private. Updates have to be triggered via
* emit updatedObject()
*
* @{ */
//===========================================================================
private:
/** \brief This function is called to update the object
*
* If the object changes, the core will call this function. This function
* triggers an vbo update in the plane node.
*
* \note Do not call this function yourself to avoid unnecessary overhead(the core will call it when it is required)
*/
void
update
(
UpdateType
_type
=
UPDATE_ALL
);
/** @} */
};
//=============================================================================
...
...
ObjectTypes/Skeleton/SkeletonObject.cc
View file @
4629ca45
...
...
@@ -693,5 +693,14 @@ BaseObject* SkeletonObject::copy()
return
dynamic_cast
<
BaseObject
*>
(
pObject
);
}
// ===============================================================================
// Update
// ===============================================================================
void
SkeletonObject
::
update
(
UpdateType
_type
)
{
BaseObject
::
update
(
_type
);
}
//=============================================================================
ObjectTypes/Skeleton/SkeletonObject.hh
View file @
4629ca45
...
...
@@ -80,6 +80,9 @@
/** This class provides the functionality for all kind of meshes for the framework
*/
class
DLLEXPORT
SkeletonObject
:
public
BaseObjectData
{
friend
class
TypeSkeletonPlugin
;
public:
/// Constructor
SkeletonObject
();
...
...
@@ -168,6 +171,28 @@ class DLLEXPORT SkeletonObject : public BaseObjectData {
void
updateMotionPath
();
void
updateMotionPath
(
const
AnimationHandle
&
_hAni
);
//===========================================================================
/** @name Update handling
*
* This is mostly private. Updates have to be triggered via
* emit updatedObject()
*
* @{ */
//===========================================================================
private:
/** \brief This function is called to update the object
*
* If the object changes, the core will call this function. This function
* triggers an vbo update in the plane node.
*
* \note Do not call this function yourself to avoid unnecessary overhead(the core will call it when it is required)
*/
void
update
(
UpdateType
_type
=
UPDATE_ALL
);
/** @} */
};
//=============================================================================
...
...
ObjectTypes/Sphere/SphereObject.cc
View file @
4629ca45
...
...
@@ -234,5 +234,13 @@ bool SphereObject::pickingEnabled() {
return
sphereNode_
->
pickingEnabled
();
}
// ===============================================================================
// Update
// ===============================================================================
/// Update the whole Object (Selection,Topology,...)
void
SphereObject
::
update
(
UpdateType
_type
)
{
BaseObject
::
update
(
_type
);
}
//=============================================================================
ObjectTypes/Sphere/SphereObject.hh
View file @
4629ca45
...
...
@@ -78,6 +78,8 @@
class
DLLEXPORT
SphereObject
:
public
BaseObjectData
{
friend
class
TypeSpherePlugin
;
public:
/// constructor
SphereObject
();
...
...
@@ -138,6 +140,8 @@ class DLLEXPORT SphereObject : public BaseObjectData {
/** @} */
//===========================================================================
/** @name Picking
* @{ */
...
...
@@ -154,6 +158,21 @@ class DLLEXPORT SphereObject : public BaseObjectData {
/** @} */
//===========================================================================
/** @name Update handling
*
* This is mostly private. Updates have to be triggered via
* emit updatedObject()
*
* @{ */
//===========================================================================
private:
/// Update the whole Object (Selection,Topology,...)
virtual
void
update
(
UpdateType
_type
=
UPDATE_ALL
);
/** @} */
};
//=============================================================================
...
...
ObjectTypes/SplatCloud/SplatCloudObject.hh
View file @
4629ca45
...
...
@@ -81,6 +81,9 @@
class
DLLEXPORT
SplatCloudObject
:
public
BaseObjectData
{
friend
class
TypeSplatCloudPlugin
;
public:
/// Constructor
SplatCloudObject
();
...
...
@@ -127,10 +130,21 @@ protected:
/// Initialise current Object, including all related Nodes
virtual
void
init
(
const
SplatCloud
*
_splatCloud
=
0
);
public:
//===========================================================================
/** @name Update handling
*
* This is mostly private. Updates have to be triggered via
* emit updatedObject()
*
* @{ */
//===========================================================================
private:
/// Called by the core if the object has to be updated
void
update
(
UpdateType
_type
=
UPDATE_ALL
);
/** @} */
//--------------------------------
/** @name Name and Path handling
* @{ */
...
...
ObjectTypes/VolumeMeshObject/VolumeMeshObject.hh
View file @
4629ca45
...
...
@@ -70,6 +70,10 @@
template
<
class
MeshT
>
class
DLLEXPORTONLY
VolumeMeshObject
:
public
BaseObjectData
{
friend
class
TypePolyhedralMeshPlugin
;
friend
class
TypeHexahedralMeshPlugin
;
public:
/** \brief copy constructor
...
...
@@ -118,24 +122,6 @@ public:
/// return a pointer to the mesh
MeshT
*
mesh
();
/// Update the whole Object (Selection,Topology,...)
virtual
void
update
(
UpdateType
_type
=
UPDATE_ALL
);
/// Call this function to update the selection
void
updateSelection
();
/// Update Geometry of all data structures
void
updateGeometry
();
/// Update Colors of all data structures
void
updateColor
();
/// Update Texture of all data structures
void
updateTexture
();
/// Update Topology of all data structures
void
updateTopology
();
/** return a full copy of this object ( All scenegraph nodes will be created )
* but the object will not be a part of the object tree.
*/
...
...
@@ -171,6 +157,35 @@ public:
/** @} */
//===========================================================================
/** @name Update handling
*
* This is mostly private. Updates have to be triggered via
* emit updatedObject()
*
* @{ */
//===========================================================================
private:
/// Update the whole Object (Selection,Topology,...)
virtual
void
update
(
UpdateType
_type
=
UPDATE_ALL
);
/// Call this function to update the selection
void
updateSelection
();
/// Update Geometry of all data structures
void
updateGeometry
();
/// Update Colors of all data structures
void
updateColor
();
/// Update Texture of all data structures
void
updateTexture
();
/// Update Topology of all data structures
void
updateTopology
();
/** @} */
//===========================================================================
/** @name Visualization
* @{ */
...
...
OpenFlipper/common/BaseObjectData.hh
View file @
4629ca45
...
...
@@ -104,6 +104,9 @@ typedef ACG::SceneGraph::StencilRefNode StencilRefNode;
*/
class
DLLEXPORT
BaseObjectData
:
public
BaseObject
{
friend
class
Core
;
Q_OBJECT
public:
...
...
@@ -282,18 +285,18 @@ class DLLEXPORT BaseObjectData : public BaseObject
/** @} */
//===========================================================================
/** @name
Content
/** @name
Update handling
* @{ */
//===========================================================================
p
ublic
:
p
rivate
:
/** \brief This function is called to update the object
*
* If the object changes, the core will call this function. Normally this will update
* the corresponding scenegraph nodes or trigger other data handling which has to be done
* when the object changes.
*
* \note Do not call this function yourself to avoid unnecessary overhead(the core will call it when it is required)
* \note Do not call this function yourself to avoid unnecessary overhead(the core will call it
via the type plugins
when it is required)
*/
virtual
void
update
(
UpdateType
_type
=
UPDATE_ALL
);
...
...
Plugin-HoleFilling/HoleFillerPlugin.cc
View file @
4629ca45
...
...
@@ -159,11 +159,10 @@ void HoleFillerPlugin::slotFillSelection(){
}
//update the object
o_it
->
update
(
);
emit
updatedObject
(
o_it
->
id
(),
UPDATE_ALL
);
holeInfo
->
getHoles
();
o_it
->
update
();
update_menu
();
emit
createBackup
(
o_it
->
id
(),
"Hole Filling"
,
UPDATE_GEOMETRY
|
UPDATE_TOPOLOGY
|
UPDATE_SELECTION
);
}
...
...
@@ -215,7 +214,7 @@ void HoleFillerPlugin::slotItemSelectionChanged() {