VICUS Library
Documentation of Vicus library
Loading...
Searching...
No Matches
VICUS::Object Class Referenceabstract

#include <VICUS_Object.h>

Inheritance diagram for VICUS::Object:
[legend]

Public Member Functions

 Object ()=default
 
 Object (Object const &)=default
 
virtual ~Object ()
 
ObjectfindChild (unsigned int ID)
 
const ObjectfindChild (unsigned int ID) const
 
void collectChildIDs (std::set< unsigned int > &nodeContainer) const
 
virtual const char * typeinfo () const =0
 
QString info () const
 

Public Attributes

Objectm_parent = nullptr
 
unsigned int m_id = INVALID_ID
 
bool m_selected = false
 
bool m_visible = true
 
QString m_displayName
 
std::string m_ifcGUID
 

Protected Attributes

std::vector< Object * > m_children
 

Detailed Description

Base class for all objects that have a parent and are shown in the navigation tree widget.

Also, each object has a unique ID m_id that is used throughout the user interface and data model to identify it.

Note: whenever you add/remove an object in the item hierarchy, make sure to call updateParents() in top level node.

Constructor & Destructor Documentation

◆ Object() [1/2]

VICUS::Object::Object ( )
default

Standard C'tor.

◆ Object() [2/2]

VICUS::Object::Object ( Object const &  )
default

Default copy constructor.

◆ ~Object()

VICUS::Object::~Object ( )
virtual

D'tor.

Member Function Documentation

◆ collectChildIDs()

void VICUS::Object::collectChildIDs ( std::set< unsigned int > &  nodeContainer) const

Recursively selected all unique IDs of children, includes the object's ID itself as well.

Note
IDs are added to the container which is not cleared initially!

◆ findChild() [1/2]

Object * VICUS::Object::findChild ( unsigned int  ID)

Recursively searches through data hierarchy and returns pointer to object matching the given ID.

Returns
Returns pointer to wanted object or nullptr, if it couldn't be found.

◆ findChild() [2/2]

const Object * VICUS::Object::findChild ( unsigned int  ID) const

Same as function above, const version.

◆ info()

QString VICUS::Object::info ( ) const

Returns a descriptive string with object type, ID and optionally displayname that helps identifying this object.

◆ typeinfo()

virtual const char * VICUS::Object::typeinfo ( ) const
pure virtual

Returns a short descriptive string usable for error messages that identifies the object type.

Implemented in VICUS::Building, VICUS::BuildingLevel, VICUS::Network, VICUS::NetworkEdge, VICUS::NetworkNode, VICUS::Room, VICUS::SubSurface, and VICUS::Surface.

Member Data Documentation

◆ m_children

std::vector<Object *> VICUS::Object::m_children
protected

List of all children.

◆ m_displayName

QString VICUS::Object::m_displayName

The descriptive name of the object.

◆ m_id

unsigned int VICUS::Object::m_id = INVALID_ID

Persistant ID of object (not the unique ID, may not be unique in DB model, must be handled appropriately in error handling).

◆ m_ifcGUID

std::string VICUS::Object::m_ifcGUID

Contains a GUID to a IFC object in case of import from IFC.

◆ m_parent

Object* VICUS::Object::m_parent = nullptr

Parent pointer, do not modify.

◆ m_selected

bool VICUS::Object::m_selected = false

Stores visibility information for this surface.

◆ m_visible

bool VICUS::Object::m_visible = true

Stores visibility information for this surface (serialized manually in derived classes).


The documentation for this class was generated from the following files: