VICUS Library
Documentation of Vicus library
|
#include <VICUS_Project.h>
Classes | |
struct | RoomMapping |
Public Types | |
enum | SelectionGroups { SG_Building = 0x001 , SG_Network = 0x002 , SG_Obstacle = 0x004 , SG_All = SG_Building | SG_Network | SG_Obstacle , NUM_SG } |
enum | SenorType { ST_Horizontal , ST_North , ST_East , ST_South , ST_West , NUM_ST } |
Public Member Functions | |
Project () | |
Project (const Project &)=default | |
void | parseHeader (const IBK::Path &filename) |
void | readXML (const IBK::Path &filename) |
void | readXML (const QString &projectText) |
void | readXMLDocument (TiXmlElement *rootElement) |
void | writeXML (const IBK::Path &filename) const |
void | readDirectoryPlaceholdersXML (const TiXmlElement *element) |
void | writeDirectoryPlaceholdersXML (TiXmlElement *parent) const |
void | updatePointers () |
void | addChildSurface (const VICUS::Surface &s) |
unsigned int | nextUnusedID () const |
VICUS::Object * | objectById (unsigned int id) |
const VICUS::Object * | objectById (unsigned int id) const |
VICUS::Room * | roomByID (unsigned int roomID) |
const VICUS::Room * | roomByID (unsigned int roomID) const |
VICUS::Surface * | surfaceByID (unsigned int surfaceID) |
const VICUS::Surface * | surfaceByID (unsigned int surfaceID) const |
VICUS::SubSurface * | subSurfaceByID (unsigned int surfID) |
const VICUS::SubSurface * | subSurfaceByID (unsigned int surfID) const |
void | selectObjects (std::set< const Object * > &selectedObjs, SelectionGroups sg, bool takeSelected, bool takeVisible) const |
void | selectChildSurfaces (std::set< const Object * > &selectedObjs, const VICUS::Surface &s, bool takeSelected, bool takeVisible) const |
bool | selectedSubSurfaces (std::vector< const SubSurface * > &subSurfaces, const VICUS::Project::SelectionGroups &sg) const |
bool | selectedSurfaces (std::vector< const Surface * > &surfaces, const VICUS::Project::SelectionGroups &sg) const |
bool | selectedRooms (std::vector< const Room * > &rooms) const |
QString | newUniqueBuildingName (const QString &baseName) const |
QString | newUniqueBuildingLevelName (const QString &baseName) const |
QString | newUniqueRoomName (const QString &baseName) const |
QString | newUniqueSurfaceName (const QString &baseName) const |
QString | newUniqueSubSurfaceName (const QString &baseName) const |
void | generateNandradProject (NANDRAD::Project &p, QStringList &errorStack, const std::string &nandradProjectPath) const |
void | generateNetworkProjectData (NANDRAD::Project &p, QStringList &errorStack, const std::string &nandradProjectPath) const |
void | generateHeatLoadExport () |
Static Public Member Functions | |
static IBKMK::Vector3D | boundingBox (std::vector< const Surface * > &surfaces, std::vector< const SubSurface * > &subsurfaces, IBKMK::Vector3D ¢er) |
static IBKMK::Vector3D | boundingBox (const std::vector< const NetworkEdge * > &edges, const std::vector< const NetworkNode * > &nodes, IBKMK::Vector3D ¢er) |
static IBKMK::Vector3D | boundingBox (std::vector< const VICUS::Surface * > &surfaces, std::vector< const VICUS::SubSurface * > &subsurfaces, IBKMK::Vector3D ¢er, const IBKMK::Vector3D &offset, const IBKMK::Vector3D &xAxis, const IBKMK::Vector3D &yAxis, const IBKMK::Vector3D &zAxis) |
static bool | connectSurfaces (double maxDist, double maxAngle, const std::set< const VICUS::Surface * > &selectedSurfaces, std::vector< VICUS::ComponentInstance > &newComponentInstances) |
Public Attributes | |
NANDRAD::ProjectInfo | m_projectInfo |
NANDRAD::SolverParameter | m_solverParameter |
NANDRAD::SimulationParameter | m_simulationParameter |
NANDRAD::Location | m_location |
VICUS::Outputs | m_outputs |
ViewSettings | m_viewSettings |
std::vector< Network > | m_geometricNetworks |
std::vector< Building > | m_buildings |
std::vector< ComponentInstance > | m_componentInstances |
std::vector< SubSurfaceComponentInstance > | m_subSurfaceComponentInstances |
PlainGeometry | m_plainGeometry |
std::map< std::string, IBK::Path > | m_placeholders |
EmbeddedDatabase | m_embeddedDB |
NANDRAD::FMIDescription | m_fmiDescription |
IBK::Path | m_ifcFilePath |
The project data structure for the SIM-VICUS user interface.
Private read-write functions.
Bitmasks for different selection groups used in selectObjects().
Enumerator | |
---|---|
SG_Building | |
SG_Network | |
SG_Obstacle | |
SG_All | |
NUM_SG |
VICUS::Project::Project | ( | ) |
Constructor, creates dummy data.
|
default |
Generate default copy constructor.
void VICUS::Project::addChildSurface | ( | const VICUS::Surface & | s | ) |
Adds child surfaces to pointers of project.
|
static |
This function computes the global bounding box of all selected surfaces and the center point in global coordinates.
|
static |
This function computes the global bounding box of all selected surfaces and the center point in global coordinates.
|
static |
This function computes the bounding box of all selected surfaces and the center point in LOCAL coordinates of the provided local coordinate system.
|
static |
Attempts to create new surface-surface connections based on the current selection. Newly created component instances are stored in vector newComponentInstances alongside original component instances. Existing component instances that reference now connected surfaces are removed. The component is selected based on existing component instances.
void VICUS::Project::generateHeatLoadExport | ( | ) |
void VICUS::Project::generateNandradProject | ( | NANDRAD::Project & | p, |
QStringList & | errorStack, | ||
const std::string & | nandradProjectPath | ||
) | const |
Converts VICUS data structure into NANDRAD project file. This function throws an error message in case the conversion failed.
p | The NANDRAD project to be populated. |
void VICUS::Project::generateNetworkProjectData | ( | NANDRAD::Project & | p, |
QStringList & | errorStack, | ||
const std::string & | nandradProjectPath | ||
) | const |
QString VICUS::Project::newUniqueBuildingLevelName | ( | const QString & | baseName | ) | const |
QString VICUS::Project::newUniqueBuildingName | ( | const QString & | baseName | ) | const |
QString VICUS::Project::newUniqueRoomName | ( | const QString & | baseName | ) | const |
QString VICUS::Project::newUniqueSubSurfaceName | ( | const QString & | baseName | ) | const |
QString VICUS::Project::newUniqueSurfaceName | ( | const QString & | baseName | ) | const |
unsigned int VICUS::Project::nextUnusedID | ( | ) | const |
Searches through all objects and determines the largest object ID (not unique ID!) used for buildings, buildingLevels, rooms, surface, subsurfaces, networks, etc and returns the next ID to be used for new data elements. For example, if IDs 10, 11, 14 have been used already, the function returns 15.
Object * VICUS::Project::objectById | ( | unsigned int | id | ) |
Searches through all objects in project structure for the object with the object ID.
|
inline |
Searches through all objects in project structure for the object with the object ID. Const version of the above function.
void VICUS::Project::parseHeader | ( | const IBK::Path & | filename | ) |
Parses only the header of the XML file. This function is supposed to be fast, yet not a complete XML parser.
filename | The full path to the project file. |
void VICUS::Project::readDirectoryPlaceholdersXML | ( | const TiXmlElement * | element | ) |
Reads the placeholder section into m_placeholders map.
void VICUS::Project::readXML | ( | const IBK::Path & | filename | ) |
Reads the project data from an XML file.
filename | The full path to the project file. |
void VICUS::Project::readXML | ( | const QString & | projectText | ) |
Reads the project data from an text which contains XML.
projectText | Text with VICUS project. |
void VICUS::Project::readXMLDocument | ( | TiXmlElement * | rootElement | ) |
Actual read function, called from both variants of readXML().
|
inline |
Tries to find a room with given ID. A convenience function that uses objectById() internally.
|
inline |
Const-version of the function above.
void VICUS::Project::selectChildSurfaces | ( | std::set< const Object * > & | selectedObjs, |
const VICUS::Surface & | s, | ||
bool | takeSelected, | ||
bool | takeVisible | ||
) | const |
Select all child surfaces of surface.
bool VICUS::Project::selectedRooms | ( | std::vector< const Room * > & | rooms | ) | const |
This function collects the pointers to all selected rooms. This is a convenience function which essentially does the same as selectObjects, but only returns visible and selected objects of type Room. Type of wich should be returned can be set with
bool VICUS::Project::selectedSubSurfaces | ( | std::vector< const SubSurface * > & | subSurfaces, |
const VICUS::Project::SelectionGroups & | sg | ||
) | const |
This function collects the pointers to all selected sub surfaces. This is a convenience function which essentially does the same as selectObjects, but only returns visible and selected objects of type SubSurface.
bool VICUS::Project::selectedSurfaces | ( | std::vector< const Surface * > & | surfaces, |
const VICUS::Project::SelectionGroups & | sg | ||
) | const |
This function collects the pointers to all selected surfaces. This is a convenience function which essentially does the same as selectObjects, but only returns visible and selected objects of type Surface.
void VICUS::Project::selectObjects | ( | std::set< const Object * > & | selectedObjs, |
SelectionGroups | sg, | ||
bool | takeSelected, | ||
bool | takeVisible | ||
) | const |
Selects objects and return set with pointers according to additional filters.
selectedObjs | Here the pointers to selected objects are returned. |
sg | Selection group, that the object belongs to. |
takeSelected | If true, only objects with "selected" property enabled are taken. If false, selection property is ignored. |
takeVisible | If true, only objects with "visible" property enabled are taken. If false, visible property is ignored. |
|
inline |
Tries to find a sub-surface with given ID. A convenience function that uses objectById() internally.
|
inline |
Const-version of the function above.
|
inline |
Tries to find a surface with given ID. A convenience function that uses objectById() internally.
|
inline |
Const-version of the function above.
void VICUS::Project::updatePointers | ( | ) |
Call this function whenever project data has changed that depends on objects linked through pointers (building hierarchies, networks etc.). Checks interrelated definitions/references for validity. Throws IBK::Exceptions in case of errors. Call this function after reading a project and during debugging after project modifications to ensure data consistency.
void VICUS::Project::writeDirectoryPlaceholdersXML | ( | TiXmlElement * | parent | ) | const |
Writes the section with directory place holders.
void VICUS::Project::writeXML | ( | const IBK::Path & | filename | ) | const |
Writes the project file to an XML file.
filename | The full path to the project file. |
std::vector<Building> VICUS::Project::m_buildings |
std::vector<ComponentInstance> VICUS::Project::m_componentInstances |
All components actually placed in the geometry. This vector is outside buildings, so that two building parts can be connected with a component.
EmbeddedDatabase VICUS::Project::m_embeddedDB |
Holds the database elements referenced in the project. These are a copy of db elements in the built-in and user-database and stored for project exchange between computers.
NANDRAD::FMIDescription VICUS::Project::m_fmiDescription |
Definitions for exporting an FMU from the model.
std::vector<Network> VICUS::Project::m_geometricNetworks |
IBK::Path VICUS::Project::m_ifcFilePath |
Contains a file name for a IFC model in case of import from IFC.
NANDRAD::Location VICUS::Project::m_location |
Location and climate settings for NANDRAD.
VICUS::Outputs VICUS::Project::m_outputs |
Output definitions.
std::map< std::string, IBK::Path > VICUS::Project::m_placeholders |
Path placeholder mappings used to substitute placeholders for database and user databases. These placeholders are read from the path placeholders section of the project file and hold a full directory path for a given placeholder name. You can compose a placeholder yourself:
PlainGeometry VICUS::Project::m_plainGeometry |
Vector with plain (dumb) geometry.
NANDRAD::ProjectInfo VICUS::Project::m_projectInfo |
NANDRAD::SimulationParameter VICUS::Project::m_simulationParameter |
Simulation parameters for NANDRAD.
NANDRAD::SolverParameter VICUS::Project::m_solverParameter |
Solver parameters for NANDRAD.
std::vector<SubSurfaceComponentInstance> VICUS::Project::m_subSurfaceComponentInstances |
ViewSettings VICUS::Project::m_viewSettings |