Commit 4629ca45 authored by Jan Möbius's avatar Jan Möbius

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
......@@ -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);
/** @} */
......
......@@ -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);
/** @} */
//===========================================================================
......
......@@ -230,5 +230,15 @@ bool CameraObject::pickingEnabled() {
return cameraNode_->pickingEnabled();
}
// ===============================================================================
// Update
// ===============================================================================
void CameraObject::update(UpdateType _type) {
BaseObject::update(_type);
}
//=============================================================================
......@@ -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);
/** @} */
};
//=============================================================================
......
......@@ -225,5 +225,15 @@ bool CoordsysObject::pickingEnabled() {
return coordsysNode_->pickingEnabled();
}
// ===============================================================================
// Update
// ===============================================================================
void CoordsysObject::update(UpdateType _type) {
BaseObject::update(_type);
}
//=============================================================================
......@@ -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);
/** @} */
};
//=============================================================================
......
......@@ -343,6 +343,5 @@ void LightObject::update(UpdateType _type) {
lightNodeVis_->setLightSource(lightSource_);
}
//=============================================================================
......@@ -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();
};
//=============================================================================
......
......@@ -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()
*
* @{ */
//===========================================================================
public:
private:
/** \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
......
......@@ -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_;
/** @} */
......
......@@ -249,5 +249,14 @@ bool QtWidgetObject::visible() {
}
// ===============================================================================
// Update
// ===============================================================================
void QtWidgetObject::update(UpdateType _type) {
BaseObject::update(_type);
}
//=============================================================================
......@@ -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 );
/** @} */
};
//=============================================================================
......
......@@ -693,5 +693,14 @@ BaseObject* SkeletonObject::copy()
return dynamic_cast<BaseObject*>(pObject);
}
// ===============================================================================
// Update
// ===============================================================================
void SkeletonObject::update(UpdateType _type) {
BaseObject::update(_type);
}
//=============================================================================
......@@ -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 );
/** @} */
};
//=============================================================================
......
......@@ -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);
}
//=============================================================================
......@@ -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);
/** @} */
};
//=============================================================================
......
......@@ -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
* @{ */
......
......@@ -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
* @{ */
......
......@@ -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
* @{ */
//===========================================================================
public:
private:
/** \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 );
......
......@@ -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() {
holeInfo->selectHole( holes[i] );
//update the object
o_it->update();
emit updatedObject(o_it->id(),UPDATE_SELECTION);
}
// DATATYPE is POLYMESH
else if ( o_it->dataType( DATA_POLY_MESH ) ) {
......@@ -239,7 +238,7 @@ void HoleFillerPlugin::slotItemSelectionChanged() {
holeInfo->selectHole( holes[i] );
//update the object
o_it->update();
emit updatedObject(o_it->id(),UPDATE_SELECTION);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment