|
FEDEM Model Database
R8.0
Source code of the FEDEM model database
|
Base parent class for the model data structure entries. More...
#include <FmBase.H>


Public Types | |
| enum | CopyMode { NOTHING , SHALLOW , DEEP_UNRESOLVED , DEEP_APPEND , DEEP_REPLACE } |
| Enumerator for the different copying modes. More... | |
Public Types inherited from FFaFieldContainer | |
| using | FindCB = FFaDynCB4< FFaFieldContainer *&, int, int, const IntVec & > |
| Convenience alias for resolve call-backs. More... | |
Public Member Functions | |
| FmBase * | getNext () const |
| Returns the next object in the linked list. More... | |
| FmBase * | getPrev () const |
| Returns the previous object in the linked list. More... | |
| virtual std::string | getUserDescription (size_t maxLength=0) const |
| Returns the user-defined description of this object. More... | |
| virtual bool | setUserDescription (const std::string &descr) |
| Sets the user-defined description of this object. More... | |
| bool | makeCopyDescr () |
| Prepends "Copy of " to the user description. More... | |
| virtual std::string | getInfoString () const |
| Returns a composed string describing this object. More... | |
| virtual std::string | getIdPath (bool withBrackets=true) const |
| Returns the user ID including the sub-assembly path. More... | |
| std::string | getIdString (bool withDescription=false) const |
| Returns a composed string describing this object. More... | |
| int | getID () const |
| Returns the user ID of this object. More... | |
| void | setID (int Id) |
| Sets the user ID of this object. More... | |
| void | getAssemblyID (IntVec &assID) const |
| Retrieves the assembly ID of this object. More... | |
| FmBase * | getParentAssembly () const |
| Returns the sub-assembly this object is part of, if any. More... | |
| FmBase * | getCommonAncestor (const FmBase *other) const |
| Returns the sub-assembly both *this and *other descent from. More... | |
| void | setParentAssembly (FmBase *subAss) |
| Sets the parent sub-assembly for this object. More... | |
| void | setParentAssembly (int Id, int classType=-1) |
| Sets the parent sub-assembly for this object. More... | |
| int | getResolvedID () const final |
| Returns the user Id of *this, for use in I/O and resolving. More... | |
| void | getResolvedAssemblyID (IntVec &assID) const final |
| Gets the assembly path of *this, for use in I/O and resolving. More... | |
| bool | cloneOrConnect () |
| Inserts or copies this object into the model database. More... | |
| virtual bool | connect () |
| Inserts this object into the model database. More... | |
| virtual bool | disconnect () |
| Removes this object from the model database. More... | |
| virtual void | drawObject () |
| Visualization interface for objects that can be rendered. More... | |
| bool | isPartOf (const FmSubAssembly *subAss) const |
| Returns true if *this is part of the specified sub-assembly. More... | |
| std::ostream & | writeFields (std::ostream &os) const |
| Writes all data fields of this object to the given output stream. More... | |
| virtual std::ostream & | writeFMF (std::ostream &os) |
| Writes out this object in the model database file format. More... | |
| virtual bool | clone (FmBase *, int) |
| Copies the fields of another object into *this. More... | |
| virtual FmBase * | clone (int) const |
| Returns an unconnected copy of this object. More... | |
| virtual const char * | getUITypeName () const |
| Returns the type name of this object for use in the GUI. More... | |
| virtual void | onMainConnected () |
| Invokes call-backs after this object is inserted into the database. More... | |
| virtual void | onMainDisconnected () |
| Invokes call-backs after this object is removed from the database. More... | |
| virtual void | onMainAboutToDisconnect () |
| Invokes call-backs before this object is removed from the database. More... | |
Public Member Functions inherited from FFaFieldContainer | |
| FFaFieldContainer () | |
| The default constructor does nothing. More... | |
| virtual | ~FFaFieldContainer () |
| The destructor clears the references to *this in myRefBy. More... | |
| bool | erase () |
| Deletes *this assuming it is heap-allocated. More... | |
| void | getFields (FieldMap &mapToFill) const |
| Builds a map of all fields in this FFaFieldContainer. More... | |
| FFaFieldBase * | getField (const std::string &fieldName) const |
| Returns the named field in this FFaFieldContainer. More... | |
| void | getReferredObjs (ObjectMap &mapToFill) const |
| Builds a map of all other objects referred to by *this. More... | |
| void | getReferringObjs (ObjectMap &mapToFill) const |
| Builds a map of all other objects referring to *this. More... | |
| void | getReferringObjs (ObjectVec &vecToFill, const std::string &contextName, bool sortOnId=false) const |
| Builds a list of FFaFieldContainer objects referring to *this. More... | |
| template<class T > | |
| void | getReferringObjs (std::vector< T * > &vecToFill, const std::string &context="", bool sortOnId=false) const |
| Builds a list of class T objects referring to *this. More... | |
| template<class T > | |
| bool | hasReferringObjs (T *&ptr, const std::string &context="") const |
| Checks if there are any references of type T to this object. More... | |
| void | releaseReferencesToMe (const std::string &contextName="", FFaFieldContainer *replacement=NULL) |
| Directly removes all references to this object. More... | |
| void | resolve (FindCB &findCB) |
| Resolves all FFaReferences and FFaReferenceLists in this object. More... | |
| void | unresolve () |
| Unresolves all FFaReferences and FFaReferenceLists in this object. More... | |
| virtual void | initAfterResolve () |
| Initializes the fields after resolve. More... | |
| void | updateReferences (int oldAssId, int newAssId) |
| Updates the assembly ID in the references in this object. More... | |
| void | updateReferences (const IntVec &oldAssId, const IntVec &newAssID) |
| Updates the assembly ID in the references in this object. More... | |
| bool | readField (const std::string &key, std::istream &is, bool datafieldsOnly=false) |
| Reads the value of a field named key from an input stream. More... | |
| bool | copy (const FFaFieldContainer *other, bool fieldsOnly=false, bool unresolve=false) |
| Copies all fields and references from another object into *this. More... | |
| bool | copyFields (const FFaFieldContainer *obj) |
| Copies all field values from another object into *this. More... | |
| bool | resetFields (const FFaFieldContainer *obj) |
| Resets fields to their default value. More... | |
Protected Member Functions | |
| FmBase (bool isDummy=false) | |
| Default constructor. More... | |
| virtual | ~FmBase () |
| Empty destructor. More... | |
| bool | eraseOrConnect () |
| Conditionally inserts this object into the model database. More... | |
| bool | mainConnect (bool allowNonUniqueIDs=false) |
| Inserts this object into the model database, unless aready present. More... | |
| bool | mainDisconnect () |
| Removes this object from the model database, if present. More... | |
| void | insertAfter (FmBase *afterPt) |
| Inserts *this after *afterPt in the database ring. More... | |
| virtual bool | cloneLocal (FmBase *obj, int depth) |
| Clones the data fields of *obj into *this. More... | |
Protected Member Functions inherited from FFaFieldContainer | |
| virtual bool | eraseOptions () |
| Hook for class-specific tasks before deleting *this in erase(). More... | |
| void | addRef (FFaReferenceBase *ref) |
| Adds a reference to the internal book keeping of this object. More... | |
| void | addRefList (FFaReferenceListBase *list) |
| Adds a reference list to the internal book keeping of this object. More... | |
| void | addField (const std::string &identifier, FFaFieldBase *field) |
| Adds a field to the internal book keeping of this object. More... | |
| void | removeField (const std::string &identifier) |
| Removes the field from the internal book keeping of this object. More... | |
Static Protected Member Functions | |
| static bool | localParse (const char *keyWord, std::istream &activeStatement, FmBase *obj) |
| Parses the keyWord field for *obj, if it is a defined field. More... | |
Private Attributes | |
| FFaField< std::string > | myDescription |
| User-defined description text. More... | |
| FFaNoCopyField< int > | myID |
| User ID, unique only within one type. More... | |
| FFaReference< FmBase > | myParentAssembly |
| Reference to the parent sub-assembly of this object, if any. More... | |
| FFaField< FFaReferenceBase * > | myParentAssemblyField |
| Data field for the reference to the parent sub-assembly. More... | |
| FmBase * | itsNextRingPt |
| Pointer to the next entry in the main ring. More... | |
| FmBase * | itsPrevRingPt |
| Pointer to the previous entry in the main ring. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from FFaFieldContainer | |
| static void | removeDictInstance () |
| Removes the heap-allocated field name dictionary. More... | |
Protected Types inherited from FFaFieldContainer | |
| using | FDict = std::set< std::string > |
| Convenience type alias, a set of text strings used as a dictionary. More... | |
| using | FDictIt = FDict::const_iterator |
| Convenience type alias, a const_iterator pointing into a dictionary. More... | |
| using | FieldContainerMap = std::map< FDictIt, FFaFieldBase *, FDictLess > |
| Convenience type alias, a field container map. More... | |
| using | FieldContainerDict = FFaSingelton< FDict, FFaFieldContainer > |
| Convenience type alias, a heap-allocated dictionary singelton. More... | |
Protected Attributes inherited from FFaFieldContainer | |
| FieldContainerMap | myFields |
| All data fields of this object. More... | |
Base parent class for the model data structure entries.
Very little functionality is included in this class. It is mostly concerned with the user ID and description, and pointers used for storing objects in the linked lists which constitute the model database.
| enum FmBase::CopyMode |
Enumerator for the different copying modes.
|
explicitprotected |
Default constructor.
|
protectedvirtual |
Empty destructor.
|
inlinevirtual |
Copies the fields of another object into *this.
Reimplemented in FmTriad, FmSubAssembly, FmPart, FmVesselMotion, FmUserDefinedElement, FmTransFriction, FmTire, FmStrainRosette, FmStraightMaster, FmSticker, FmSpringChar, FmSimpleSensor, FmSeaState, FmRotFriction, FmRoad, FmRigidJoint, FmRevJoint, FmRelativeSensor, FmRefPlane, FmRackPinion, FmPrismJoint, FmPipeSurface, FmModesOptions, FmModelExpOptions, FmMechanism, FmMaterialProperty, FmLoad, FmJointSpring, FmJointDamper, FmGraph, FmGlobalViewSettings, FmGenericDBObject, FmGear, FmGageOptions, FmfWaveSpectrum, FmfWaveSinus, FmfUserDefined, FmfStep, FmfSquarePuls, FmfSpline, FmfSmoothTraj, FmfSinusoidal, FmfScale, FmFreeJoint, FmfRamp, FmFppOptions, FmfMathExpr, FmfLinVelVar, FmfLinVar, FmfLimRamp, FmFileReference, FmfExternalFunction, FmfDiracPuls, FmfDeviceFunction, FmfDelayedComplSinus, FmfConstant, FmfComplSinus, FmExternalCtrlSys, FmEngine, FmDofMotion, FmDofLoad, FmCylJoint, FmCurveSet, FmCtrlLine, FmcOutput, FmcInput, FmcTimeDelay, FmcSampleHold, FmcRealPole, FmcPower, FmcPlimIlimD, FmcPlimI, FmcPlimD, FmcPid, FmcPi, FmcPd, FmcPIlimD, FmcMultiplier, FmcLogicalSwitch, FmcLimitation, FmcLimDerivator, FmcIntegrator, FmcHysteresis, FmcDeadZone, FmcComparator, FmcCompConjPole, FmcAmplifier, FmcAdder, Fmc2ordTF, Fmc1ordTF, FmCamJoint, FmBladeProperty, FmBeamProperty, FmBeam, FmBallJoint, FmAxialSpring, FmAxialDamper, FmArcSegmentMaster, FmAnimation, FmAnalysis, and FmAirState.
|
inlinevirtual |
Returns an unconnected copy of this object.
Reimplemented in FmSimulationModelBase, and FmResultBase.
|
protectedvirtual |
Clones the data fields of *obj into *this.
This method tries to copy all fields of the cloned object into this object.
Reimplemented in FmTriad, FmSubAssembly, FmSimulationModelBase, FmResultBase, FmPart, FmModelMemberBase, FmLink, FmVesselMotion, FmUserDefinedElement, FmTransFriction, FmTire, FmStrainRosette, FmStraightMaster, FmSticker, FmSpringChar, FmSpringBase, FmSMJointBase, FmSimpleSensor, FmSensorBase, FmSeaState, FmRotFriction, FmRoad, FmRigidJoint, FmRevJoint, FmRelativeSensor, FmRefPlane, FmRackPinion, FmPrismJoint, FmPipeSurface, FmModesOptions, FmModelExpOptions, FmMMJointBase, FmMechanism, FmMathFuncBase, FmMaterialProperty, FmLoad, FmJointSpring, FmJointMotion, FmJointDamper, FmJointBase, FmIsRenderedBase, FmIsPositionedBase, FmIsPlottedBase, FmIsMeasuredBase, FmIsControlledBase, FmHPBase, FmHasDOFsBase, FmGraph, FmGlobalViewSettings, FmGenericDBObject, FmGear, FmGageOptions, FmfWaveSpectrum, FmfWaveSinus, FmfUserDefined, FmfStep, FmfSquarePuls, FmfSpline, FmfSmoothTraj, FmfSinusoidal, FmfScale, FmFrictionBase, FmFreeJoint, FmfRamp, FmFppOptions, FmfMultiVarBase, FmfMultiArgBase, FmfMathExpr, FmfLinVelVar, FmfLinVar, FmfLimRamp, FmFileReference, FmfExternalFunction, FmfDiracPuls, FmfDeviceFunction, FmfDelayedComplSinus, FmfConstant, FmfComplSinus, FmExternalCtrlSys, FmEngine, FmDofMotion, FmDofLoad, FmDamperBase, FmCylJoint, FmCurveSet, FmCtrlOutputElementBase, FmCtrlLine, FmCtrlInputElementBase, FmCtrlElementBase, FmcOutput, FmcInput, FmcTimeDelay, FmcSampleHold, FmcRealPole, FmcPower, FmcPlimIlimD, FmcPlimI, FmcPlimD, FmcPid, FmcPi, FmcPd, FmcPIlimD, FmcMultiplier, FmcLogicalSwitch, FmcLimitation, FmcLimDerivator, FmcIntegrator, FmcHysteresis, FmcDeadZone, FmcComparator, FmcCompConjPole, FmcAmplifier, FmcAdder, Fmc2ordTF, Fmc1ordTF, FmCamJoint, FmBladeProperty, FmBeamProperty, FmBeam, FmBallJoint, FmAxialSpring, FmAxialDamper, FmArcSegmentMaster, FmAnimation, FmAnalysis, FmAirState, and Fm1DMaster.
| bool FmBase::cloneOrConnect | ( | ) |
Inserts or copies this object into the model database.
This method is used from model file reading, but only for objects that might have been created before reading the model file. If the object to be connected (*this) already exists in the database, all data is copied (cloned) from this object into the found object. This object is then deleted.
|
inlinevirtual |
Inserts this object into the model database.
Reimplemented in FmResultBase, FmCurveSet, FmTimeSensor, FmSimulationEvent, and FmRingStart.
|
inlinevirtual |
Removes this object from the model database.
Reimplemented in FmTriad, FmSticker, FmRingStart, FmLoad, FmJointSpring, FmJointDamper, FmEngine, FmElementGroupProxy, FmDofMotion, FmDofLoad, FmCurveSet, and FmCtrlLine.
|
inlinevirtual |
Visualization interface for objects that can be rendered.
Reimplemented in FmIsRenderedBase.
|
protected |
Conditionally inserts this object into the model database.
This method should be used in place of connect(bool) for all objects that should be ignored when importing an existing model as a sub-assembly. Returns true if the object is successfully connected and false if it is erased or the connection failed.
| void FmBase::getAssemblyID | ( | IntVec & | assID | ) | const |
Retrieves the assembly ID of this object.
The "live" path is returned if the model is resolved, and the read path if not.
The assembly path vector is ordered from top to bottom. <Root, sub,... , leaf>
Returns the sub-assembly both *this and *other descent from.
|
inline |
Returns the user ID of this object.
|
virtual |
Returns the user ID including the sub-assembly path.
Reimplemented in FmElementGroupProxy.
| std::string FmBase::getIdString | ( | bool | withDescription = false | ) | const |
Returns a composed string describing this object.
Mainly used to refer to this object in Output List error messages, etc.
|
virtual |
Returns a composed string describing this object.
Mainly used to refer to this object in pulldown menus, etc.
Reimplemented in FmTimeSensor, FmSimpleSensor, FmRelativeSensor, FmMathFuncBase, FmEngine, and FmElementGroupProxy.
|
inline |
Returns the next object in the linked list.
|
inline |
Returns the sub-assembly this object is part of, if any.
|
inline |
Returns the previous object in the linked list.
|
finalvirtual |
Gets the assembly path of *this, for use in I/O and resolving.
This method returns a vector of the ID's of the hierarchy of sub-assemblies containing this object. The input vector must be empty. It gets the resolved "live" assembly ID and returns nothing if the model is not resolved.
The "path" to this object: MainModel.SubAss.SubAss...SubAss
Reimplemented from FFaFieldContainer.
|
inlinefinalvirtual |
Returns the user Id of *this, for use in I/O and resolving.
Reimplemented from FFaFieldContainer.
|
virtual |
Returns the type name of this object for use in the GUI.
Reimplemented in FmTriad, FmSubAssembly, FmPart, FmVesselMotion, FmUserDefinedElement, FmBlade, FmRotor, FmShaft, FmGearBox, FmGenerator, FmNacelle, FmTower, FmTurbine, FmTransFriction, FmTire, FmTimeSensor, FmStructAssembly, FmStrainRosette, FmStraightMaster, FmSticker, FmSpringChar, FmSoilPile, FmSimulationEvent, FmSimpleSensor, FmSeaState, FmRotFriction, FmRoad, FmRiser, FmRingStart, FmRigidJoint, FmRevJoint, FmRelativeSensor, FmRefPlane, FmRackPinion, FmPrismJoint, FmPrismaticFriction, FmPipeSurface, FmPipeStringDataExporter, FmModesOptions, FmModelExpOptions, FmMechanism, FmMathFuncBase, FmMaterialProperty, FmLoad, FmJointSpring, FmJointMotion, FmJointDamper, FmJacket, FmGraph, FmGlobalViewSettings, FmGenericDBObject, FmGear, FmGageOptions, FmFreeJoint, FmFppOptions, FmFileReference, FmExternalCtrlSys, FmEngine, FmElementGroupProxy, FmDofMotion, FmDofLoad, FmCylJoint, FmCurveSet, FmCtrlLine, FmcOutput, FmcInput, FmcTimeDelay, FmcSampleHold, FmcRealPole, FmcPower, FmcPlimIlimD, FmcPlimI, FmcPlimD, FmcPid, FmcPi, FmcPd, FmcPIlimD, FmcMultiplier, FmcLogicalSwitch, FmcLimitation, FmcLimDerivator, FmcIntegrator, FmcHysteresis, FmcDeadZone, FmcComparator, FmcCompConjPole, FmcAmplifier, FmcAdder, Fmc2ordTF, Fmc1ordTF, FmCamJoint, FmCamFriction, FmBladeDesign, FmBladeProperty, FmBearingFriction, FmBeamProperty, FmBeam, FmBallJoint, FmAxialSpring, FmAxialDamper, FmArcSegmentMaster, FmAnimation, FmAnalysis, and FmAirState.
|
virtual |
Returns the user-defined description of this object.
If maxLength is non-zero, only the first maxLength characters are returned, or only the first line if that is shorter than maxLength.
Reimplemented in FmElementGroupProxy.
|
protected |
Inserts *this after *afterPt in the database ring.
| bool FmBase::isPartOf | ( | const FmSubAssembly * | subAss | ) | const |
Returns true if *this is part of the specified sub-assembly.
|
staticprotected |
Parses the keyWord field for *obj, if it is a defined field.
|
protected |
Inserts this object into the model database, unless aready present.
|
protected |
Removes this object from the model database, if present.
| bool FmBase::makeCopyDescr | ( | ) |
Prepends "Copy of " to the user description.
|
inlinevirtual |
Invokes call-backs before this object is removed from the database.
Reimplemented in FmModelMemberBase.
|
inlinevirtual |
Invokes call-backs after this object is inserted into the database.
Reimplemented in FmModelMemberBase.
|
inlinevirtual |
Invokes call-backs after this object is removed from the database.
Reimplemented in FmModelMemberBase.
|
inline |
Sets the user ID of this object.
| void FmBase::setParentAssembly | ( | FmBase * | subAss | ) |
Sets the parent sub-assembly for this object.
| void FmBase::setParentAssembly | ( | int | Id, |
| int | classType = -1 |
||
| ) |
Sets the parent sub-assembly for this object.
|
virtual |
Sets the user-defined description of this object.
Reimplemented in FmElementGroupProxy.
| std::ostream & FmBase::writeFields | ( | std::ostream & | os | ) | const |
Writes all data fields of this object to the given output stream.
|
inlinevirtual |
Writes out this object in the model database file format.
Reimplemented in FmTriad, FmSubAssembly, FmPart, FmVesselMotion, FmUserDefinedElement, FmBlade, FmRotor, FmShaft, FmGearBox, FmGenerator, FmNacelle, FmTower, FmTurbine, FmTransFriction, FmTire, FmStructAssembly, FmStrainRosette, FmStraightMaster, FmSticker, FmSpringChar, FmSoilPile, FmSimulationEvent, FmSimpleSensor, FmSeaState, FmRotFriction, FmRoad, FmRiser, FmRigidJoint, FmRevJoint, FmRelativeSensor, FmRefPlane, FmRackPinion, FmPrismJoint, FmPrismaticFriction, FmPipeSurface, FmPipeStringDataExporter, FmModesOptions, FmModelExpOptions, FmMechanism, FmMaterialProperty, FmLoad, FmJointSpring, FmJointMotion, FmJointDamper, FmJacket, FmGraph, FmGlobalViewSettings, FmGenericDBObject, FmGear, FmGageOptions, FmfWaveSpectrum, FmfWaveSinus, FmfUserDefined, FmfStep, FmfSquarePuls, FmfSpline, FmfSmoothTraj, FmfSinusoidal, FmfScale, FmFreeJoint, FmfRamp, FmFppOptions, FmfMathExpr, FmfLinVelVar, FmfLinVar, FmfLimRamp, FmFileReference, FmfExternalFunction, FmfDiracPuls, FmfDeviceFunction, FmfDelayedComplSinus, FmfConstant, FmfComplSinus, FmExternalCtrlSys, FmEngine, FmElementGroupProxy, FmDofMotion, FmDofLoad, FmCylJoint, FmCurveSet, FmCtrlLine, FmcOutput, FmcInput, FmcTimeDelay, FmcSampleHold, FmcRealPole, FmcPower, FmcPlimIlimD, FmcPlimI, FmcPlimD, FmcPid, FmcPi, FmcPd, FmcPIlimD, FmcMultiplier, FmcLogicalSwitch, FmcLimitation, FmcLimDerivator, FmcIntegrator, FmcHysteresis, FmcDeadZone, FmcComparator, FmcCompConjPole, FmcAmplifier, FmcAdder, Fmc2ordTF, Fmc1ordTF, FmCamJoint, FmCamFriction, FmBladeDesign, FmBladeProperty, FmBearingFriction, FmBeamProperty, FmBeam, FmBallJoint, FmAxialSpring, FmAxialDamper, FmArcSegmentMaster, FmAnimation, FmAnalysis, and FmAirState.
|
private |
Pointer to the next entry in the main ring.
|
private |
Pointer to the previous entry in the main ring.
|
private |
User-defined description text.
|
private |
User ID, unique only within one type.
|
private |
Reference to the parent sub-assembly of this object, if any.
|
private |
Data field for the reference to the parent sub-assembly.