61 virtual std::string
getIdPath(
bool withBrackets =
true)
const;
63 std::string
getIdString(
bool withDescription =
false)
const;
107 virtual std::ostream&
writeFMF(std::ostream& os) {
return os; }
146 explicit FmBase(
bool isDummy =
false);
161 static bool localParse(
const char* keyWord, std::istream& activeStatement,
Base class for the FEDEM model database structure.
Template class for field representation in the FEDEM model database.
std::vector< int > IntVec
Convenience type alias.
Definition: FFaField.H:25
Classes representing guarded pointers.
#define Fmd_DB_HEADER_INIT()
Macro enabling type checking for a class.
Definition: FmTypeCheck.H:24
Base class for the FEDEM model database structure.
Definition: FFaFieldContainer.H:39
bool setValue(const ValueT &newData, bool checkChanged=true)
Assigns a new value to the field.
Definition: FFaField.H:66
const ValueT & getValue() const
Returns a const reference to myData.
Definition: FFaField.H:56
Type * getPointer() const
Returns the type-casted pointer this reference points to.
Definition: FFaReference.H:234
Base parent class for the model data structure entries.
Definition: FmBase.H:37
virtual std::string getInfoString() const
Returns a composed string describing this object.
Definition: FmBase.C:387
virtual void drawObject()
Visualization interface for objects that can be rendered.
Definition: FmBase.H:96
virtual std::ostream & writeFMF(std::ostream &os)
Writes out this object in the model database file format.
Definition: FmBase.H:107
bool cloneOrConnect()
Inserts or copies this object into the model database.
Definition: FmBase.C:194
bool mainConnect(bool allowNonUniqueIDs=false)
Inserts this object into the model database, unless aready present.
Definition: FmBase.C:228
int getID() const
Returns the user ID of this object.
Definition: FmBase.H:66
void insertAfter(FmBase *afterPt)
Inserts *this after *afterPt in the database ring.
Definition: FmBase.C:276
bool makeCopyDescr()
Prepends "Copy of " to the user description.
Definition: FmBase.C:421
FFaField< FFaReferenceBase * > myParentAssemblyField
Data field for the reference to the parent sub-assembly.
Definition: FmBase.H:139
int getResolvedID() const final
Returns the user Id of *this, for use in I/O and resolving.
Definition: FmBase.H:83
FFaReference< FmBase > myParentAssembly
Reference to the parent sub-assembly of this object, if any.
Definition: FmBase.H:137
void getAssemblyID(IntVec &assID) const
Retrieves the assembly ID of this object.
Definition: FmBase.C:126
bool isPartOf(const FmSubAssembly *subAss) const
Returns true if *this is part of the specified sub-assembly.
Definition: FmBase.C:108
bool eraseOrConnect()
Conditionally inserts this object into the model database.
Definition: FmBase.C:176
FmBase * itsPrevRingPt
Pointer to the previous entry in the main ring.
Definition: FmBase.H:142
FmBase * getPrev() const
Returns the previous object in the linked list.
Definition: FmBase.H:46
virtual FmBase * clone(int) const
Returns an unconnected copy of this object.
Definition: FmBase.H:111
virtual bool setUserDescription(const std::string &descr)
Sets the user-defined description of this object.
Definition: FmBase.C:344
FmBase * getCommonAncestor(const FmBase *other) const
Returns the sub-assembly both *this and *other descent from.
Definition: FmBase.C:153
CopyMode
Enumerator for the different copying modes.
Definition: FmBase.H:124
@ SHALLOW
Copy all data fields, but not the references.
Definition: FmBase.H:126
@ DEEP_APPEND
Also copy and resolve references.
Definition: FmBase.H:128
@ DEEP_REPLACE
Also copy references, replacing existing ones.
Definition: FmBase.H:129
@ NOTHING
Don't copy any data fields.
Definition: FmBase.H:125
@ DEEP_UNRESOLVED
Also copy references, but leave them unresolved.
Definition: FmBase.H:127
FmBase * itsNextRingPt
Pointer to the next entry in the main ring.
Definition: FmBase.H:141
void getResolvedAssemblyID(IntVec &assID) const final
Gets the assembly path of *this, for use in I/O and resolving.
Definition: FmBase.C:143
virtual std::string getUserDescription(size_t maxLength=0) const
Returns the user-defined description of this object.
Definition: FmBase.C:371
virtual std::string getIdPath(bool withBrackets=true) const
Returns the user ID including the sub-assembly path.
Definition: FmBase.C:69
virtual bool connect()
Inserts this object into the model database.
Definition: FmBase.H:92
void setID(int Id)
Sets the user ID of this object.
Definition: FmBase.H:68
virtual bool clone(FmBase *, int)
Copies the fields of another object into *this.
Definition: FmBase.H:109
FmBase * getNext() const
Returns the next object in the linked list.
Definition: FmBase.H:44
virtual void onMainDisconnected()
Invokes call-backs after this object is removed from the database.
Definition: FmBase.H:119
FmBase * getParentAssembly() const
Returns the sub-assembly this object is part of, if any.
Definition: FmBase.H:73
virtual const char * getUITypeName() const
Returns the type name of this object for use in the GUI.
Definition: FmBase.C:409
virtual void onMainAboutToDisconnect()
Invokes call-backs before this object is removed from the database.
Definition: FmBase.H:121
FmBase(bool isDummy=false)
Default constructor.
Definition: FmBase.C:37
virtual ~FmBase()
Empty destructor.
Definition: FmBase.C:59
std::ostream & writeFields(std::ostream &os) const
Writes all data fields of this object to the given output stream.
Definition: FmBase.C:302
virtual bool cloneLocal(FmBase *obj, int depth)
Clones the data fields of *obj into *this.
Definition: FmBase.C:317
FFaField< std::string > myDescription
User-defined description text.
Definition: FmBase.H:133
virtual void onMainConnected()
Invokes call-backs after this object is inserted into the database.
Definition: FmBase.H:117
bool mainDisconnect()
Removes this object from the model database, if present.
Definition: FmBase.C:285
FFaNoCopyField< int > myID
User ID, unique only within one type.
Definition: FmBase.H:134
virtual bool disconnect()
Removes this object from the model database.
Definition: FmBase.H:94
void setParentAssembly(FmBase *subAss)
Sets the parent sub-assembly for this object.
Definition: FmBase.C:100
std::string getIdString(bool withDescription=false) const
Returns a composed string describing this object.
Definition: FmBase.C:398
static bool localParse(const char *keyWord, std::istream &activeStatement, FmBase *obj)
Parses the keyWord field for *obj, if it is a defined field.
Definition: FmBase.C:329
Definition: FmRingStart.H:16
Base class for all sub-assembly objects.
Definition: FmSubAssembly.H:28