FEDEM Model Database  R8.0
Source code of the FEDEM model database
Typedefs | Functions
FmDB Namespace Reference

Typedefs

using FmHeadMap = std::map< int, FmRingStart * >
 

Functions

void init ()
 
void removeInstances ()
 
void initHeadMap (FmHeadMap &headMap, FmFuncTree *&funcTree)
 
void sortHeadMap (const FmHeadMap &headMap, FmHeadMap &sortedHeadMap, bool reverse=false)
 
FmModelMemberBase * createObject (int classTypeId)
 
FmMechanism * newMechanism ()
 
FmRingStart * getHead (int classTypeID)
 
FmRingStart * getHead (int classTypeID, const std::vector< int > &assemblyID, const FmHeadMap *root=NULL)
 
bool findIDrange (const FmBase *obj, int &fromID, int &toID)
 
FmBase * findID (int type, int IDnr, const std::vector< int > &assemblyID={})
 
FmBase * findID (const std::string &type, int IDnr, const std::vector< int > &assemblyID={})
 
void getAllPaths (std::vector< FFaField< std::string > * > &allPathNames, const FmSubAssembly *subAss=NULL)
 
void translateRelativePaths (const std::string &oldModelPath, const std::string &newModelPath, const FmSubAssembly *subAss=NULL)
 
bool purgeJointComponents ()
 
bool updateModelVersionOnSave (bool warnOnNewVersion)
 
bool reportAll (std::ostream &os=std::cout, bool writeMetaData=true, const FmHeadMap *headMap=NULL, const char *metaData=NULL)
 
void reportMembers (std::ostream &os, const FmHeadMap *headMap)
 
void displayAll (const FmHeadMap *headMap=NULL)
 
bool eraseAll (bool showProgress=false)
 
void forAllInDB (FFaDynCB2< bool &, FmBase * > &toBeCalled4EachHead, FFaDynCB1< FmBase * > &toBeCalled4Each, const FmHeadMap *root=NULL)
 
int getObjectCount (int type, const FmHeadMap *root=NULL)
 
void getQuery (std::vector< FmModelMemberBase * > &toBeFilled, FmQuery *query)
 
bool getAllOfType (std::vector< FmModelMemberBase * > &toBeFilled, int typeID, const FmSubAssembly *subAss=NULL, const char *tag=NULL)
 
bool hasObjectsOfType (int typeID, const FmHeadMap *root=NULL)
 
void getFEParts (std::vector< FmPart * > &toFill, bool reverseOrder=false)
 
void getUnsavedParts (std::vector< FmPart * > &toFill)
 
void getAllParts (std::vector< FmPart * > &toFill, const FmSubAssembly *subAss=NULL, bool thisLevelOnly=false)
 
void getAllBeams (std::vector< FmBeam * > &toFill, const FmSubAssembly *subAss=NULL, bool thisLevelOnly=false)
 
void getAllLinks (std::vector< FmLink * > &toFill, const FmSubAssembly *subAss=NULL, bool thisLevelOnly=false)
 
void getAllTriads (std::vector< FmTriad * > &toFill, const FmSubAssembly *subAss=NULL, bool thisLevelOnly=false)
 
void getAllFunctions (std::vector< FmMathFuncBase * > &toFill, const FmSubAssembly *subAss=NULL, bool thisLevelOnly=false)
 
void getAllSplines (std::vector< FmfSpline * > &toFill)
 
void getAllMultiVarFuncs (std::vector< FmfMultiVarBase * > &toFill)
 
void getAllDeviceFunctions (std::vector< FmfDeviceFunction * > &toFill)
 
void getAllJoints (std::vector< FmJointBase * > &toFill)
 
void getAllHPs (std::vector< FmHPBase * > &toFill)
 
void getAllGears (std::vector< FmGear * > &toFill)
 
void getAllRackPinions (std::vector< FmRackPinion * > &toFill)
 
void getAllCylJoints (std::vector< FmCylJoint * > &toFill)
 
void getAllCamJoints (std::vector< FmCamJoint * > &toFill)
 
void getAllRevJoints (std::vector< FmRevJoint * > &toFill)
 
void getAllBallJoints (std::vector< FmBallJoint * > &toFill)
 
void getAllFreeJoints (std::vector< FmFreeJoint * > &toFill)
 
void getAllRigidJoints (std::vector< FmRigidJoint * > &toFill)
 
void getAllPrismJoints (std::vector< FmPrismJoint * > &toFill)
 
void getAllControlLines (std::vector< FmCtrlLine * > &toFill)
 
void getAllLoads (std::vector< FmLoad * > &toFill)
 
void getAllAxialSprings (std::vector< FmAxialSpring * > &toFill)
 
void getAllJointSprings (std::vector< FmJointSpring * > &toFill)
 
void getAllSpringChars (std::vector< FmSpringChar * > &toFill)
 
void getAllAxialDampers (std::vector< FmAxialDamper * > &toFill)
 
void getAllJointDampers (std::vector< FmJointDamper * > &toFill)
 
void getAllSensors (std::vector< FmSensorBase * > &toFill)
 
void getAllEngines (std::vector< FmEngine * > &engines)
 
void getAllExternalCtrlSys (std::vector< FmExternalCtrlSys * > &toFill)
 
void getAllRefPlanes (std::vector< FmRefPlane * > &toFill)
 
void getAllStickers (std::vector< FmSticker * > &toFill)
 
void getAllControlOutput (std::vector< FmcOutput * > &toFill)
 
void getAllControlInput (std::vector< FmcInput * > &toFill)
 
void getAllControlElements (std::vector< FmCtrlInputElementBase * > &toFill)
 
void getAllBladeDesigns (std::vector< FmBladeDesign * > &toFill)
 
void getAllSimulationEvents (std::vector< FmSimulationEvent * > &toFill, bool reverseOrder=false)
 
bool readAll (const std::string &name, char ignoreFileVersion=0)
 
int readFMF (std::istream &is)
 
void unknownKeyword (const char *keyWord, const FmBase *obj)
 
FmGlobalViewSettings * getActiveViewSettings (bool createIfNone=true)
 
FmAnalysis * getActiveAnalysis (bool createIfNone=true)
 
FmModesOptions * getModesOptions (bool createIfNone=true)
 
FmGageOptions * getGageOptions (bool createIfNone=true)
 
FmFppOptions * getFppOptions (bool createIfNone=true)
 
FmModelExpOptions * getModelExportOptions (bool createIfNone=true)
 
FmVesselMotion * getActiveRAO ()
 
double getPositionTolerance ()
 
double getParallelTolerance ()
 
void setParallelTolerance (double eps)
 
const FaVec3 & getGrav ()
 
void drawGVector ()
 
FaMat34 getSeaCS ()
 
bool useSeaCS ()
 
void drawSea ()
 
FmLink * getEarthLink ()
 
FmSensorBase * getTimeSensor (bool createIfNone=true)
 
FmSeaState * getSeaStateObject (bool createIfNone=true)
 
FmAirState * getAirStateObject (bool createIfNone=true)
 
FmMechanism * getMechanismObject (bool createIfNone=true)
 
FmTurbine * getTurbineObject (int ID=0)
 
void emergencyExitSave ()
 
void eraseAllStickers ()
 
void eraseAllControlObjects ()
 
bool hasObjects (int typeID, const FmHeadMap *root=NULL)
 
const FFaVersionNumber & getModelFileVer ()
 
const FmHeadMap * getHeadMap (const FmSubAssembly *subAss=NULL)
 
FmSubAssembly * getSubAssembly (const std::vector< int > &assemblyID)
 
FmModelMemberBase * findObject (int baseID)
 
bool insertInBaseIDMap (FmModelMemberBase *pt)
 
void removeFromBaseIDMap (FmModelMemberBase *pt)
 
int getFreeBaseID ()
 
void resolveObject (FmBase *obj)
 
void initAfterResolveObject (FmBase *obj)
 

Typedef Documentation

◆ FmHeadMap

using FmDB::FmHeadMap = typedef std::map<int,FmRingStart*>

Function Documentation

◆ createObject()

FmModelMemberBase * FmDB::createObject ( int  classTypeId)

◆ displayAll()

void FmDB::displayAll ( const FmHeadMap *  headMap = NULL)

◆ drawGVector()

void FmDB::drawGVector ( )

◆ drawSea()

void FmDB::drawSea ( )

◆ emergencyExitSave()

void FmDB::emergencyExitSave ( )

◆ eraseAll()

bool FmDB::eraseAll ( bool  showProgress = false)

◆ eraseAllControlObjects()

void FmDB::eraseAllControlObjects ( )

◆ eraseAllStickers()

void FmDB::eraseAllStickers ( )

◆ findID() [1/2]

FmBase * FmDB::findID ( const std::string &  type,
int  IDnr,
const std::vector< int > &  assemblyID = {} 
)

◆ findID() [2/2]

FmBase * FmDB::findID ( int  type,
int  IDnr,
const std::vector< int > &  assemblyID = {} 
)

◆ findIDrange()

bool FmDB::findIDrange ( const FmBase *  obj,
int &  fromID,
int &  toID 
)

◆ findObject()

FmModelMemberBase * FmDB::findObject ( int  baseID)

◆ forAllInDB()

void FmDB::forAllInDB ( FFaDynCB2< bool &, FmBase * > &  toBeCalledForEachHead,
FFaDynCB1< FmBase * > &  toBeCalledForEach,
const FmHeadMap *  root = NULL 
)

Traverses all the objects in the DB. For each group of objects toBeCalledForEachHead is called, and the CB is supposed to set the passed bool variable to false if the current group is not to be traversed.

Groups that do not contain any objects are ignored.

◆ getActiveAnalysis()

FmAnalysis * FmDB::getActiveAnalysis ( bool  createIfNone = true)

◆ getActiveRAO()

FmVesselMotion * FmDB::getActiveRAO ( )

◆ getActiveViewSettings()

FmGlobalViewSettings * FmDB::getActiveViewSettings ( bool  createIfNone = true)

◆ getAirStateObject()

FmAirState * FmDB::getAirStateObject ( bool  createIfNone = true)

◆ getAllAxialDampers()

void FmDB::getAllAxialDampers ( std::vector< FmAxialDamper * > &  toFill)

◆ getAllAxialSprings()

void FmDB::getAllAxialSprings ( std::vector< FmAxialSpring * > &  toFill)

◆ getAllBallJoints()

void FmDB::getAllBallJoints ( std::vector< FmBallJoint * > &  toFill)

◆ getAllBeams()

void FmDB::getAllBeams ( std::vector< FmBeam * > &  toFill,
const FmSubAssembly *  subAss = NULL,
bool  thisLevelOnly = false 
)

◆ getAllBladeDesigns()

void FmDB::getAllBladeDesigns ( std::vector< FmBladeDesign * > &  toFill)

◆ getAllCamJoints()

void FmDB::getAllCamJoints ( std::vector< FmCamJoint * > &  toFill)

◆ getAllControlElements()

void FmDB::getAllControlElements ( std::vector< FmCtrlInputElementBase * > &  toFill)

◆ getAllControlInput()

void FmDB::getAllControlInput ( std::vector< FmcInput * > &  toFill)

◆ getAllControlLines()

void FmDB::getAllControlLines ( std::vector< FmCtrlLine * > &  toFill)

◆ getAllControlOutput()

void FmDB::getAllControlOutput ( std::vector< FmcOutput * > &  toFill)

◆ getAllCylJoints()

void FmDB::getAllCylJoints ( std::vector< FmCylJoint * > &  toFill)

◆ getAllDeviceFunctions()

void FmDB::getAllDeviceFunctions ( std::vector< FmfDeviceFunction * > &  toFill)

◆ getAllEngines()

void FmDB::getAllEngines ( std::vector< FmEngine * > &  engines)

◆ getAllExternalCtrlSys()

void FmDB::getAllExternalCtrlSys ( std::vector< FmExternalCtrlSys * > &  toFill)

◆ getAllFreeJoints()

void FmDB::getAllFreeJoints ( std::vector< FmFreeJoint * > &  toFill)

◆ getAllFunctions()

void FmDB::getAllFunctions ( std::vector< FmMathFuncBase * > &  toFill,
const FmSubAssembly *  subAss = NULL,
bool  thisLevelOnly = false 
)

◆ getAllGears()

void FmDB::getAllGears ( std::vector< FmGear * > &  toFill)

◆ getAllHPs()

void FmDB::getAllHPs ( std::vector< FmHPBase * > &  toFill)

◆ getAllJointDampers()

void FmDB::getAllJointDampers ( std::vector< FmJointDamper * > &  toFill)

◆ getAllJoints()

void FmDB::getAllJoints ( std::vector< FmJointBase * > &  toFill)

◆ getAllJointSprings()

void FmDB::getAllJointSprings ( std::vector< FmJointSpring * > &  toFill)

◆ getAllLinks()

void FmDB::getAllLinks ( std::vector< FmLink * > &  toFill,
const FmSubAssembly *  subAss = NULL,
bool  thisLevelOnly = false 
)

◆ getAllLoads()

void FmDB::getAllLoads ( std::vector< FmLoad * > &  toFill)

◆ getAllMultiVarFuncs()

void FmDB::getAllMultiVarFuncs ( std::vector< FmfMultiVarBase * > &  toFill)

◆ getAllOfType()

bool FmDB::getAllOfType ( std::vector< FmModelMemberBase * > &  toBeFilled,
int  classTypeID,
const FmSubAssembly *  subAss = NULL,
const char *  tag = NULL 
)

This fills a vector of all objects in the DB of requested type. The function returns false if no objects of the type queried for are found.

◆ getAllParts()

void FmDB::getAllParts ( std::vector< FmPart * > &  toFill,
const FmSubAssembly *  subAss = NULL,
bool  thisLevelOnly = false 
)

◆ getAllPaths()

void FmDB::getAllPaths ( std::vector< FFaField< std::string > * > &  allPathNames,
const FmSubAssembly *  subAss = NULL 
)

Utility to collect all fields in the model containing a file path.

◆ getAllPrismJoints()

void FmDB::getAllPrismJoints ( std::vector< FmPrismJoint * > &  toFill)

◆ getAllRackPinions()

void FmDB::getAllRackPinions ( std::vector< FmRackPinion * > &  toFill)

◆ getAllRefPlanes()

void FmDB::getAllRefPlanes ( std::vector< FmRefPlane * > &  toFill)

◆ getAllRevJoints()

void FmDB::getAllRevJoints ( std::vector< FmRevJoint * > &  toFill)

◆ getAllRigidJoints()

void FmDB::getAllRigidJoints ( std::vector< FmRigidJoint * > &  toFill)

◆ getAllSensors()

void FmDB::getAllSensors ( std::vector< FmSensorBase * > &  toFill)

◆ getAllSimulationEvents()

void FmDB::getAllSimulationEvents ( std::vector< FmSimulationEvent * > &  toFill,
bool  reverseOrder = false 
)

◆ getAllSplines()

void FmDB::getAllSplines ( std::vector< FmfSpline * > &  toFill)

◆ getAllSpringChars()

void FmDB::getAllSpringChars ( std::vector< FmSpringChar * > &  toFill)

◆ getAllStickers()

void FmDB::getAllStickers ( std::vector< FmSticker * > &  toFill)

◆ getAllTriads()

void FmDB::getAllTriads ( std::vector< FmTriad * > &  toFill,
const FmSubAssembly *  subAss = NULL,
bool  thisLevelOnly = false 
)

◆ getEarthLink()

FmLink * FmDB::getEarthLink ( )

◆ getFEParts()

void FmDB::getFEParts ( std::vector< FmPart * > &  toFill,
bool  reverseOrder = false 
)

◆ getFppOptions()

FmFppOptions * FmDB::getFppOptions ( bool  createIfNone = true)

◆ getFreeBaseID()

int FmDB::getFreeBaseID ( )

◆ getGageOptions()

FmGageOptions * FmDB::getGageOptions ( bool  createIfNone = true)

◆ getGrav()

const FaVec3 & FmDB::getGrav ( )

◆ getHead() [1/2]

FmRingStart * FmDB::getHead ( int  classTypeID)

◆ getHead() [2/2]

FmRingStart * FmDB::getHead ( int  classTypeID,
const std::vector< int > &  assemblyID,
const FmHeadMap *  root = NULL 
)

◆ getHeadMap()

const FmHeadMap * FmDB::getHeadMap ( const FmSubAssembly *  subAss = NULL)

◆ getMechanismObject()

FmMechanism * FmDB::getMechanismObject ( bool  createIfNone = true)

◆ getModelExportOptions()

FmModelExpOptions * FmDB::getModelExportOptions ( bool  createIfNone = true)

◆ getModelFileVer()

const FFaVersionNumber & FmDB::getModelFileVer ( )

◆ getModesOptions()

FmModesOptions * FmDB::getModesOptions ( bool  createIfNone = true)

◆ getObjectCount()

int FmDB::getObjectCount ( int  type,
const FmHeadMap *  root = NULL 
)

◆ getParallelTolerance()

double FmDB::getParallelTolerance ( )

◆ getPositionTolerance()

double FmDB::getPositionTolerance ( )

◆ getQuery()

void FmDB::getQuery ( std::vector< FmModelMemberBase * > &  toBeFilled,
FmQuery *  query 
)

◆ getSeaCS()

FaMat34 FmDB::getSeaCS ( )

◆ getSeaStateObject()

FmSeaState * FmDB::getSeaStateObject ( bool  createIfNone = true)

◆ getSubAssembly()

FmSubAssembly * FmDB::getSubAssembly ( const std::vector< int > &  assemblyID)

◆ getTimeSensor()

FmSensorBase * FmDB::getTimeSensor ( bool  createIfNone = true)

◆ getTurbineObject()

FmTurbine * FmDB::getTurbineObject ( int  ID = 0)

◆ getUnsavedParts()

void FmDB::getUnsavedParts ( std::vector< FmPart * > &  toFill)

◆ hasObjects()

bool FmDB::hasObjects ( int  typeID,
const FmHeadMap *  root = NULL 
)

◆ hasObjectsOfType()

bool FmDB::hasObjectsOfType ( int  typeID,
const FmHeadMap *  root = NULL 
)

◆ init()

void FmDB::init ( )

◆ initAfterResolveObject()

void FmDB::initAfterResolveObject ( FmBase *  obj)

◆ initHeadMap()

void FmDB::initHeadMap ( FmHeadMap &  headMap,
FmFuncTree *&  funcTree 
)

Initialization for headMap containing all entities in a model. The initialization creates one FmRingStart object for each type of object, and sets up a parent-child relationship if neccesary for use in the GUI.

The order of creation of the FmRingStart objects determines the "natural order" of DB objects, mainly used for the output order on the model file.

It is strongly advisable to add new objects at the end to keep diff'ing new and old model files as clean as possible.

◆ insertInBaseIDMap()

bool FmDB::insertInBaseIDMap ( FmModelMemberBase *  pt)

◆ newMechanism()

FmMechanism * FmDB::newMechanism ( )

◆ purgeJointComponents()

bool FmDB::purgeJointComponents ( )

Erase all joint dof spring, dampers, loads and motions that are not active. Typically invoked before a "Save", to reduce the size of the model file.

◆ readAll()

bool FmDB::readAll ( const std::string &  name,
char  ignoreFileVersion = 0 
)

Reads the model file named name into the database.

First it does some checks on the file to find the version it was saved in. The version is kept in an FmDB-internal variable for further reference.

The model file version number is parsed through the following scheme: Files starting with "FEDEMMODELFILE" and something different from "{V.0.9b ASCII}" afterwards will have that text parsed into version number. Files starting with "FEDEMMODELFILE {V.0.9b ASCII}" and with "Module version:" in the second line, will have the text following "Module version:" parsed into version number. Files starting with "FEDEMMODELFILE {V.0.9b ASCII}", without "Module version:" in the second line but with "BASE_ID" within its first 1000 lines, are assumed to be of version 2.5 - 2.5m1 Files starting with "FEDEMMODELFILE {V.0.9b ASCII}", without "Module version:" in the second line and no "BASE_ID" within its first 1000 lines, are assumed to be of version 2.1.2

◆ readFMF()

int FmDB::readFMF ( std::istream &  is)

◆ removeFromBaseIDMap()

void FmDB::removeFromBaseIDMap ( FmModelMemberBase *  pt)

◆ removeInstances()

void FmDB::removeInstances ( )

This cleans up the heap-allocated singelton objects in FmDB which are not related to a mechanism model as such. Used mainly in test programs to verify no memory leaks, etc.

◆ reportAll()

bool FmDB::reportAll ( std::ostream &  os = std::cout,
bool  writeMetaData = true,
const FmHeadMap *  headMap = NULL,
const char *  metaData = NULL 
)

◆ reportMembers()

void FmDB::reportMembers ( std::ostream &  os,
const FmHeadMap *  headMap 
)

◆ resolveObject()

void FmDB::resolveObject ( FmBase *  obj)

◆ setParallelTolerance()

void FmDB::setParallelTolerance ( double  eps)

◆ sortHeadMap()

void FmDB::sortHeadMap ( const FmHeadMap &  headMap,
FmHeadMap &  sortedHeadMap,
bool  reverse = false 
)

◆ translateRelativePaths()

void FmDB::translateRelativePaths ( const std::string &  oldPath,
const std::string &  newPath,
const FmSubAssembly *  subAss = NULL 
)

Utility to translate all relative paths in the model such that they are correct after saving, when changing the model file path of the model. Used by "Save As..." and "Export Digital Twin...".

◆ unknownKeyword()

void FmDB::unknownKeyword ( const char *  keyWord,
const FmBase *  obj 
)

◆ updateModelVersionOnSave()

bool FmDB::updateModelVersionOnSave ( bool  warnOnNewVersion)

◆ useSeaCS()

bool FmDB::useSeaCS ( )