VICUS Library
Documentation of Vicus library
|
Functions | |
int | enum2index (const std::string &enumtype) |
const char * | theKeyword (int typenum, int t) |
const char * | allKeywords (int typenum, int t) |
bool | selectionCheck (const VICUS::Object &o, bool takeSelected, bool takeVisible) |
std::string | createUniqueNandradObjListName (const std::map< std::string, std::vector< unsigned int > > &objListNames, const std::string &name) |
std::string | createUniqueNandradObjListAndName (const std::string &name, const std::vector< unsigned int > &roomIds, NANDRAD::Project &p, const NANDRAD::ModelInputReference::referenceType_t &type) |
std::vector< NANDRAD::Schedule::ScheduledDayType > | mergeDayType (const std::vector< int > &dts) |
QString | MultiLangString2QString (const IBK::MultiLanguageString &mls) |
template<typename T > | |
bool | isValidTemplate (const std::vector< T > elements, QStringList &errorStack, const QString &name) |
const VICUS::Room * | checkForSurfaceParent (const VICUS::Object *obj) |
QString | uniqueName (const QString &baseName, const std::set< QString > &existingNames) |
QString | camelCase2ReadableString (const std::string &original) |
template<typename T > | |
T * | element (std::vector< T > &vec, unsigned int id) |
template<typename T > | |
bool | contains (const std::vector< T > &vec, unsigned int id) |
template<typename T > | |
const T * | element (const std::vector< T > &vec, unsigned int id) |
template<typename T > | |
const T * | element (const std::vector< T > &vec, const std::string &name) |
template<typename T > | |
unsigned int | elementIndex (const std::vector< T > &vec, unsigned int id) |
template<typename T > | |
unsigned int | elementIndex (const std::vector< T > &vec, const std::string &name, bool caseSensitiv=true) |
template<typename T > | |
unsigned int | uniqueId (const std::vector< T > &vec) |
template<> | |
unsigned int | uniqueId (const std::vector< unsigned int > &vec) |
template<typename T > | |
unsigned int | uniqueId (const std::set< T > &vec) |
template<> | |
unsigned int | uniqueId (const std::set< unsigned int > &vec) |
template<typename T > | |
unsigned int | uniqueIdAdd (std::vector< T > &vec) |
template<typename T > | |
unsigned int | uniqueIdWithPredef (std::vector< T > &vec, unsigned int newId) |
template<typename T > | |
unsigned int | uniqueIdWithPredef (std::vector< T > &vec, unsigned int id, std::map< T, T > mapOldToNewId) |
template<typename T > | |
unsigned int | largestUniqueId (const std::vector< T > &vec) |
template<typename T > | |
void | checkForUniqueIDs (const std::vector< T > &vec, std::set< unsigned int > &usedIDs) |
template<typename T > | |
void | checkForUniqueIDs (const std::vector< const T * > &vec, std::set< unsigned int > &usedIDs) |
Variables | |
const char *const | VERSION = "1.0" |
const char *const | LONG_VERSION = "1.0.4" |
unsigned int | INVALID_ID = 0xFFFFFFFF |
const double | MIN_AREA_FOR_EXPORTED_SURFACES = 0.1 |
const char * | XML_READ_ERROR = "Error in XML file, line %1: %2" |
const char * | XML_READ_UNKNOWN_ATTRIBUTE = "Unknown/unsupported attribute '%1' in line %2." |
const char * | XML_READ_UNKNOWN_ELEMENT = "Unknown/unsupported tag '%1' in line %2." |
const char * | XML_READ_UNKNOWN_NAME = "Name '%1' for tag '%2' in line %3 is invalid/unknown." |
const char * | DATABASE_PLACEHOLDER_NAME = "Database" |
const char * | USER_DATABASE_PLACEHOLDER_NAME = "User Database" |
const char *const | INVALID_KEYWORD_INDEX_STRING = "KEYWORD_ERROR_STRING: Invalid type index" |
const char *const | ENUM_TYPES [58] |
const double | GeometricResolution = 0.01 |
const char * VICUS::allKeywords | ( | int | typenum, |
int | t | ||
) |
Returns all keywords including deprecated for a given category (typenum) and type number (t).
QString VICUS::camelCase2ReadableString | ( | const std::string & | original | ) |
Takes a string in camel case notation as input and returns a QString whith a space before each capital letter.
const VICUS::Room * VICUS::checkForSurfaceParent | ( | const VICUS::Object * | obj | ) |
void VICUS::checkForUniqueIDs | ( | const std::vector< const T * > & | vec, |
std::set< unsigned int > & | usedIDs | ||
) |
Same as function above, but for containers holding const pointers instead of objects.
void VICUS::checkForUniqueIDs | ( | const std::vector< T > & | vec, |
std::set< unsigned int > & | usedIDs | ||
) |
Test function that checks that all objects in the given vector have unique m_id parameters. The set passed as second argument is used for comparison. Pass an empty set if only the elements in the vector itself shall be tested. You can re-use the populated set for another call to this function, if you want to ensure uniqueness of several object vectors.
bool VICUS::contains | ( | const std::vector< T > & | vec, |
unsigned int | id | ||
) |
Checks if an object with m_id matching the searched id exists in the vector.
std::string VICUS::createUniqueNandradObjListAndName | ( | const std::string & | name, |
const std::vector< unsigned int > & | roomIds, | ||
NANDRAD::Project & | p, | ||
const NANDRAD::ModelInputReference::referenceType_t & | type | ||
) |
std::string VICUS::createUniqueNandradObjListName | ( | const std::map< std::string, std::vector< unsigned int > > & | objListNames, |
const std::string & | name | ||
) |
const T * VICUS::element | ( | const std::vector< T > & | vec, |
const std::string & | name | ||
) |
Utility function to find a vector element by name.
const T * VICUS::element | ( | const std::vector< T > & | vec, |
unsigned int | id | ||
) |
Function to find an element by ID (const-version).
T * VICUS::element | ( | std::vector< T > & | vec, |
unsigned int | id | ||
) |
Function to find an element by ID.
unsigned int VICUS::elementIndex | ( | const std::vector< T > & | vec, |
const std::string & | name, | ||
bool | caseSensitiv = true |
||
) |
Utility function to find a vector element's index by name.
unsigned int VICUS::elementIndex | ( | const std::vector< T > & | vec, |
unsigned int | id | ||
) |
Utility function to find a vector element by name.
int VICUS::enum2index | ( | const std::string & | enumtype | ) |
Converts a category string to respective enumeration value.
bool VICUS::isValidTemplate | ( | const std::vector< T > | elements, |
QStringList & | errorStack, | ||
const QString & | name | ||
) |
Simple valid function.
unsigned int VICUS::largestUniqueId | ( | const std::vector< T > & | vec | ) |
Function to generate a unique ID that is larger than all the other IDs used. This is useful if a series of objects with newly generated IDs shall be added to a container.
std::vector< NANDRAD::Schedule::ScheduledDayType > VICUS::mergeDayType | ( | const std::vector< int > & | dts | ) |
|
inline |
bool VICUS::selectionCheck | ( | const VICUS::Object & | o, |
bool | takeSelected, | ||
bool | takeVisible | ||
) |
const char * VICUS::theKeyword | ( | int | typenum, |
int | t | ||
) |
Returns a keyword string for a given category (typenum) and type number t.
unsigned int VICUS::uniqueId | ( | const std::set< T > & | vec | ) |
Function to generate unique (lowest not yet used) ID.
|
inline |
Function to generate unique (lowest not yet used) ID.
unsigned int VICUS::uniqueId | ( | const std::vector< T > & | vec | ) |
Function to generate unique (lowest not yet used) ID.
|
inline |
Function to generate unique (lowest not yet used) ID.
unsigned int VICUS::uniqueIdAdd | ( | std::vector< T > & | vec | ) |
Function to generate unique ID and add this ID to the vector.
unsigned int VICUS::uniqueIdWithPredef | ( | std::vector< T > & | vec, |
unsigned int | id, | ||
std::map< T, T > | mapOldToNewId | ||
) |
Function to generate unique ID. First check predefined id. Add the Id to the container.
unsigned int VICUS::uniqueIdWithPredef | ( | std::vector< T > & | vec, |
unsigned int | newId | ||
) |
Function to generate unique ID. First check predefined id. And the Id to the container.
QString VICUS::uniqueName | ( | const QString & | baseName, |
const std::set< QString > & | existingNames | ||
) |
Generates a new unique name in format "basename" or "basename (<nr>)" with increasing numbers until the name no longer exists in set existingNames. NOTE: we cannot use [<nr>] because when generating output variable names, this interferes with the unit specification.
NOTE: basename is always trimmed.
baseName | Contains the original name, which may include already "(<nr>)" |
const char * VICUS::DATABASE_PLACEHOLDER_NAME = "Database" |
const char* const VICUS::ENUM_TYPES[58] |
Holds a list of all enum types/categories.
|
extern |
Line is a helper class that implements a range of line operations. It is meant to be constructed from an edge definition. It stores the line internally in vector form a*lambda + b.
unsigned int VICUS::INVALID_ID = 0xFFFFFFFF |
Defines an invalid id
const char* const VICUS::INVALID_KEYWORD_INDEX_STRING = "KEYWORD_ERROR_STRING: Invalid type index" |
Holds the string to print as error when an invalid keyword is encountered.
const char *const VICUS::LONG_VERSION = "1.0.4" |
Long version number of the data model and project file.
const double VICUS::MIN_AREA_FOR_EXPORTED_SURFACES = 0.1 |
Minimum area for export of surfaces.
const char * VICUS::USER_DATABASE_PLACEHOLDER_NAME = "User Database" |
const char *const VICUS::VERSION = "1.0" |
Version number of the data model and project file.
const char * VICUS::XML_READ_ERROR = "Error in XML file, line %1: %2" |
const char * VICUS::XML_READ_UNKNOWN_ATTRIBUTE = "Unknown/unsupported attribute '%1' in line %2." |
const char * VICUS::XML_READ_UNKNOWN_ELEMENT = "Unknown/unsupported tag '%1' in line %2." |
const char * VICUS::XML_READ_UNKNOWN_NAME = "Name '%1' for tag '%2' in line %3 is invalid/unknown." |