anatomist 6.0.4
3D neuroimaging data viewer
anatomist::AObject Class Referenceabstract

Base Anatomist object (abstract) More...

#include <anatomist/object/Object.h>

Inheritance diagram for anatomist::AObject:
Collaboration diagram for anatomist::AObject:

Public Types

enum  ObjectType {
  VOLUME , BUCKET , FACET , TRIANG ,
  LIST , VECTOR , MAP , SET ,
  GRAPH , GRAPHOBJECT , VOLSURF , MULTISURF ,
  MULTIBUCKET , MULTIVOLUME , FUSION2D , FUSION3D ,
  FASCICLE , FASCICLEGRAPH , TEXTURE , TEXSURFACE ,
  FUSION2DMESH , VECTORFIELD , OTHER
}
 Base object type identifiers. More...
 
typedef std::set< MObject * > ParentList
 Storage type for parent objects (multi-objects containing this one)
 
typedef ObjectMenu *(* ObjectMenuRegistrerFunction) (const AObject *objtype, ObjectMenu *menu)
 dynamic menu registration function
 
- Public Types inherited from carto::RCObject
typedef int RefCounterType
 

Public Member Functions

 AObject (const std::string &filename="")
 
virtual ~AObject ()
 AObject subclasses must call cleanup() in their destructor.
 
virtual AObjectclone (bool shallow=true)
 Makes a copy of the object, with a duplicated object structure, palette and material, but which may share the underlying low-level data object (Aims object).
 
virtual const GLComponentglAPI () const
 OpenGL objects const API.
 
virtual GLComponentglAPI ()
 OpenGL objects API.
 
virtual const MObjectmObjectAPI () const
 
virtual MObjectmObjectAPI ()
 
int type () const
 Object type identifier.
 
void setType (int type)
 Method to set type id, because type() is not virtual.
 
int id () const
 Unique ID assigned upon construction, but somewhat unused now...
 
std::string name () const
 Name shown in control window.
 
std::string fileName () const
 File name (if any) for loaded objects.
 
void setName (const std::string &n)
 
void setFileName (const std::string &filename)
 
void setId (int id)
 
virtual int isMultiObject () const
 maybe not necessary ?: we can use dynamic_cast instead
 
virtual float MinT () const
 Obsolete, deprecated.
 
virtual float MaxT () const
 Obsolete, deprecated.
 
virtual bool boundingBox2D (std::vector< float > &bmin, std::vector< float > &bmax) const
 Bounding box in 2D views mode.
 
virtual bool boundingBox (std::vector< float > &bmin, std::vector< float > &bmax) const
 Fills bmin and bmax with the N-D bounding box extrema in the object's referential coordinates.
 
virtual bool render (PrimList &, const ViewState &)
 rendering (generally 2D or 3D using OpenGL).
 
virtual std::vector< float > voxelSize () const
 Returns at least 4 sizes. For 3D objects, returns (1, 1, 1, 1)
 
virtual void setVoxelSize (const std::vector< float > &)
 
virtual void internalUpdate ()
 Updates the state of the object.
 
virtual void adjustPalette ()
 Creates or updates object palette according to object values (if needed)
 
virtual AObjectPalettepalette ()
 Normally, getOrCreatePalette() should be used instead of this function in most cases.
 
virtual const AObjectPalettepalette () const
 
virtual void setPalette (const AObjectPalette &palette)
 
virtual const AObjectPalettegetOrCreatePalette () const
 User normally calls this function.
 
virtual void createDefaultPalette (const std::string &name="")
 function called by getOrCreatePalette() - overloadable, need not be called directly
 
virtual void SetMaterial (const Material &mat)
 
virtual MaterialGetMaterial ()
 
virtual const Materialmaterial () const
 
ReferentialgetReferential () const
 
AObjectreferentialInheritance () const
 if not null, the object referential is inherited from this object
 
virtual void setReferentialInheritance (AObject *ao)
 
virtual void setReferential (Referential *ref)
 
virtual AObjectfallbackReferentialInheritance () const
 object to take referential from when no ref is assigned
 
const ReferentialpreviousReferential () const
 Referential that the object was in before the last change.
 
virtual TreeoptionTree () const
 Menu tree for new options, see object/optionMatcher.h.
 
virtual ObjectMenuoptionMenu () const
 
int InMemory () const
 For objects loading only when needed (not used yet...)
 
int Visible () const
 Visibility in control window.
 
void SetVisibility (int v)
 
ParentListParents ()
 List of multi-objects containing this one. Obsolete: use parents()
 
ParentListparents ()
 List of multi-objects containing this one.
 
const ParentListparents () const
 List of multi-objects containing this one.
 
virtual void RegisterParent (MObject *pob)
 
virtual void UnregisterParent (MObject *pob)
 
const std::set< AWindow * > & WinList ()
 List of windows showing this object.
 
virtual void registerWindow (AWindow *window)
 
virtual void unregisterWindow (AWindow *window)
 
virtual bool Is2DObject ()=0
 
virtual bool Is3DObject ()=0
 
virtual bool IsFusion2DAllowed ()
 
virtual bool textured2D () const
 true if 2D rendering uses a textured plane (not a full openGL object)
 
virtual bool isTransparent () const
 
virtual bool renderingIsObserverDependent () const
 true only if the rendering (openGL) of the object changes with the observer position/orientation of the view (which is rare, but typically needed for Volume Rendering)
 
virtual int CanBeDestroyed ()
 Allows / unallows destruction of object.
 
virtual void setReferenceChanged ()
 
bool hasReferenceChanged () const
 
virtual void setInternalsChanged ()
 Notifies some underlying lower-level objects have changed.
 
virtual void clearHasChangedFlags () const
 Reset has-changed flags.
 
bool userModified () const
 if the object has been modified by user interaction, and needs saving
 
void setUserModified (bool state=true)
 if the object has been modified by user interaction, and needs saving
 
virtual AObjectobjectAt (const std::vector< float > &pos, float tol=0)
 Find the object (sub-object) at given postion with a tolerence.
 
virtual AObjectobjectAt (const std::vector< float > &pos, float tol, const Referential *orgref, const Point3df &orggeom)
 Same with origin window referential.
 
virtual const AObjectnearestVertex (const std::vector< float > &pos, int *vertex, float *distance, float tol=-1, int *polygon=0, bool tex_only=false, int target_poly=-1) const
 Get the nearest vertex to a given position.
 
virtual void setGeomExtrema ()
 Scans the object internals and determines its geometry extrema.
 
virtual void SetExtrema ()
 Scans the object internals and determines its (texture) extrema values.
 
virtual bool hasTexture () const
 Textured objects have values associated with a geometric coordinate.
 
virtual unsigned dimTexture () const
 Number of texture values for a point.
 
virtual float mixedTexValue (const std::vector< float > &pos, const Referential *orgRef, int poly=-1) const
 Gets a "mixed" texture value at a given space / time location.
 
virtual float mixedTexValue (const std::vector< float > &pos, int poly=-1) const
 Same as above except that coordinates are not transformed but taken in object coordinates system.
 
virtual std::vector< float > texValues (const std::vector< float > &pos, const Referential *orgRef, int poly=-1) const
 Gets the array of texture values at a given location.
 
virtual std::vector< float > texValues (const std::vector< float > &pos, int poly=-1) const
 
virtual carto::rc_ptr< carto::Volume< float > > texValuesSeries (const std::vector< float > &pos, int axis, const Referential *orgRef, int poly=-1) const
 
virtual carto::rc_ptr< carto::Volume< float > > texValuesSeries (const std::vector< float > &pos, int axis, int poly=-1) const
 
virtual void getTextureLabels (const std::vector< float > &texvalues, std::vector< std::string > &texlabels, std::string &textype) const
 
virtual bool loadable () const
 
virtual bool savable () const
 
virtual bool reload (const std::string &filename)
 Re-reads objects from disk.
 
virtual std::string objectFullTypeName (void) const
 Get Object Full Type Name.
 
bool allowsOverwriteOnSave () const
 
void setAllowsOverwriteOnSave (bool x)
 
bool save (const std::string &filename, bool onlyIfModified)
 
virtual bool save (const std::string &filename)
 
virtual bool printTalairachCoord (const Point3df &, const Referential *) const
 should be replaced by a real referential
 
void setHeaderOptions ()
 Set some object properties according to the header (.minf), such as material, palette etc.
 
virtual void setProperties (carto::Object options)
 Same as setHeaderOptions() and used by it, allows passing a dictionary.
 
virtual void storeHeaderOptions ()
 Store some object properties into the header (.minf), such as material, palette etc before saving the object.
 
virtual carto::Object makeHeaderOptions () const
 get object properties into a generic object, such as material, palette etc before saving the object
 
long loadDate () const
 Time the object was created, loaded or reloaded.
 
void setLoadDate (long t)
 
virtual void update (const Observable *observable, void *arg)
 This method is called whenever the observed object is changed.
 
bool isCopy () const
 
void setCopyFlag (bool x=true)
 
virtual std::string toolTip () const
 tooltip displayed in 3D views (HTML).
 
carto::Object aimsMeshFromGLComponent ()
 
- Public Member Functions inherited from anatomist::Observable
 Observable ()
 Construct an Observable with zero observers.
 
virtual ~Observable ()
 does nothing
 
void addObserver (Observer *observer)
 Adds an observer to the set of observers for this object.
 
void deleteObserver (Observer *observer)
 Deletes an observer from the set of observers of this object.
 
void deleteObservers ()
 Clears the observer list so that this object no longer has any observers (doesn't call any observer method - see notifyUnregisterObservers() for this )
 
int countObservers () const
 Returns the number of observers of this object.
 
virtual void notifyObservers (void *arg=0)
 If this object has changed, as indicated by the hasChanged method, then notify all of its observers.
 
virtual void notifyUnregisterObservers ()
 Notifies observable destruction to all observers and unregisters them.
 
bool hasChanged () const
 Tests if this object has changed.
 
bool obsHasChanged (int) const
 only valid during an Observer::update()
 
bool obsHasChanged (const std::string &) const
 only valid during an Observer::update()
 
void setChanged () const
 Indicates that this object has changed.
 
- Public Member Functions inherited from carto::SharedObject
 SharedObject ()
 
 SharedObject (const SharedObject &x)
 
virtual ~SharedObject ()
 
SharedObjectoperator= (const SharedObject &)
 
bool testDeletable ()
 
bool tryDelete ()
 
- Public Member Functions inherited from carto::WeakObject
void attachWeakPtr (weak_ptr< T > &) const
 
void detachWeakPtr (weak_ptr< T > &) const
 
void attachWeakPtr (weak_shared_ptr< T > &) const
 
void detachWeakPtr (weak_shared_ptr< T > &) const
 
virtual ~WeakObject ()
 
- Public Member Functions inherited from carto::RCObject
 RCObject ()
 
 RCObject (const RCObject &)
 
RCObjectoperator= (const RCObject &)
 
virtual ~RCObject ()
 
- Public Member Functions inherited from anatomist::Observer
virtual ~Observer ()
 

Static Public Member Functions

static std::list< AObject * > load (const std::string &filename)
 Static object loader: creates an objects, loads its contents.
 
static bool reload (AObject *object, bool onlyoutdated=false)
 Reads from disk again.
 
static int registerObjectType (const std::string &id)
 Creates a new object type number and returns it.
 
static std::string objectTypeName (int type)
 
static void setObjectMenu (std::string type, carto::rc_ptr< ObjectMenu > om)
 
static carto::rc_ptr< ObjectMenugetObjectMenu (std::string type)
 
static std::map< std::string, carto::rc_ptr< ObjectMenu > > & getObjectMenuMap ()
 
static void addObjectMenuRegistration (ObjectMenuRegistrerFunction)
 
static void addObjectMenuRegistration (ObjectMenuRegistrerClass *)
 
static void cleanStatic ()
 cleanup static global variables (called when quitting anatomist)
 

Protected Member Functions

const PrimListprimitives () const
 
PrimListprimitives ()
 
virtual void cleanup ()
 must be called by objects destructors - Must be explicitly called by each object destructor since it can call virtual functions
 
virtual void clearReferentialInheritance ()
 sets the object to get referential from to null, unregister it
 
AObject *& _referentialInheritance ()
 provide access to derived classes
 
virtual void unregisterObservable (Observable *)
 Called when an observable is destroyed, only called by Observable: don't use this function directly.
 
 AObject (const AObject &)
 copy constructor, protected and used only to reimplement clone()
 
void clearChanged () const
 Indicates that this object has no longer changed, or that it has already notified all of its observers of its most recent change.
 
void obsSetChanged (int, bool=true) const
 int-based change flags (use enums to address them)
 
void obsSetChanged (const std::string &, bool=true) const
 string-based change flags
 
- Protected Member Functions inherited from carto::SharedObject
void disableRefCount ()
 
- Protected Member Functions inherited from carto::WeakObject
 WeakObject ()
 
 WeakObject (const WeakObject &)
 
WeakObjectoperator= (const WeakObject &)
 
- Protected Member Functions inherited from anatomist::Observer
virtual void cleanupObserver ()
 call this function from inherited classes destructors.
 
virtual void registerObservable (Observable *)
 only called by Observable: don't use this function directly
 
const std::set< Observable * > & observed () const
 

Protected Attributes

int _type
 Should be static in each object class.
 
int _id
 
std::string _name
 
std::string _filename
 
std::set< AWindow * > _winList
 
int _inMemory
 
int _visible
 
ParentList _parents
 
Material _material
 Should be a pointer: some objects don't have a material (2D objects)
 
Referential_referential
 Referentiel.
 
bool _referenceHasChanged
 Reference has-changed flag.
 
AObjectPalette_palette
 Palette.
 

Static Protected Attributes

static std::map< std::string, int > _objectTypes
 name-to-type map
 
static std::map< int, std::string > _objectTypeNames
 type-to-name map
 
static std::map< std::string, carto::rc_ptr< ObjectMenu > > _objectmenu_map
 Object Menu Map.
 

Friends

class StaticInitializers
 

Detailed Description

Base Anatomist object (abstract)

Definition at line 96 of file Object.h.

Member Typedef Documentation

◆ ObjectMenuRegistrerFunction

typedef ObjectMenu *(* anatomist::AObject::ObjectMenuRegistrerFunction) (const AObject *objtype, ObjectMenu *menu)

dynamic menu registration function

Definition at line 135 of file Object.h.

◆ ParentList

Storage type for parent objects (multi-objects containing this one)

Definition at line 100 of file Object.h.

Member Enumeration Documentation

◆ ObjectType

Base object type identifiers.

Some of these base types are still unused now. New objects (unknown to the base Anatomist library) use dynamic identifiers that they must register by calling registerObjectType() once (and only once)

Enumerator
VOLUME 
BUCKET 
FACET 
TRIANG 
LIST 
VECTOR 
MAP 
SET 
GRAPH 
GRAPHOBJECT 
VOLSURF 
MULTISURF 
MULTIBUCKET 
MULTIVOLUME 
FUSION2D 
FUSION3D 
FASCICLE 
FASCICLEGRAPH 
TEXTURE 
TEXSURFACE 
FUSION2DMESH 
VECTORFIELD 
OTHER 

External object type (unknown from the base anatomist library)

Definition at line 106 of file Object.h.

Constructor & Destructor Documentation

◆ AObject() [1/2]

◆ ~AObject()

virtual anatomist::AObject::~AObject ( )
virtual

AObject subclasses must call cleanup() in their destructor.

◆ AObject() [2/2]

anatomist::AObject::AObject ( const AObject & )
protected

copy constructor, protected and used only to reimplement clone()

References AObject().

Member Function Documentation

◆ _referentialInheritance()

AObject *& anatomist::AObject::_referentialInheritance ( )
protected

provide access to derived classes

References AObject().

◆ addObjectMenuRegistration() [1/2]

static void anatomist::AObject::addObjectMenuRegistration ( ObjectMenuRegistrerClass * )
static

◆ addObjectMenuRegistration() [2/2]

static void anatomist::AObject::addObjectMenuRegistration ( ObjectMenuRegistrerFunction )
static

◆ adjustPalette()

virtual void anatomist::AObject::adjustPalette ( )
virtual

Creates or updates object palette according to object values (if needed)

Reimplemented in anatomist::AVolume< T >, and anatomist::AVolumeView< T >.

◆ aimsMeshFromGLComponent()

carto::Object anatomist::AObject::aimsMeshFromGLComponent ( )

◆ allowsOverwriteOnSave()

bool anatomist::AObject::allowsOverwriteOnSave ( ) const

◆ boundingBox()

virtual bool anatomist::AObject::boundingBox ( std::vector< float > & bmin,
std::vector< float > & bmax ) const
virtual

Fills bmin and bmax with the N-D bounding box extrema in the object's referential coordinates.

Changed in Anatomist 4.6. The older API was using Point3df instead of vector and informed only the spatial dimensions.

An object with no spatial information (a texture for instance) may still have time information. For this reason, the resulting bounding box should always have 4 components (at least), then 4th and additional ones should be valid, even if the function returns false (no spatial bounding box).

Returns
true if object has a "spatial" bounding box (x, y, z coordinates)

Reimplemented in anatomist::AConnectivityMatrix, anatomist::AGraph, anatomist::ASurface< D >, anatomist::ASurface< 2 >, anatomist::ASurface< 3 >, anatomist::ASurface< 3 >, anatomist::ATexSurface, anatomist::ATexture, anatomist::AVolume< T >, anatomist::AVolumeView< T >, anatomist::Bucket, anatomist::CutMesh, anatomist::Fusion3D, anatomist::MObject, and anatomist::PlanarFusion3D.

◆ boundingBox2D()

virtual bool anatomist::AObject::boundingBox2D ( std::vector< float > & bmin,
std::vector< float > & bmax ) const
virtual

Bounding box in 2D views mode.

In mm, may be the same as boundingBox() if the object field of view is the same in 3D and 2D modes. It normally includes voxels size (for a volume, bmin will be -vs/2 where vs is the voxel size, for the 3 first coordinates).

The default implementation just calls boundingBox().

Reimplemented in anatomist::AGraph, anatomist::AVolume< T >, anatomist::AVolumeView< T >, anatomist::Bucket, anatomist::Fusion2DMesh, and anatomist::MObject.

◆ CanBeDestroyed()

virtual int anatomist::AObject::CanBeDestroyed ( )
virtual

Allows / unallows destruction of object.

(cannot be destroyed if part of some other kind of multi-object)

◆ cleanStatic()

static void anatomist::AObject::cleanStatic ( )
static

cleanup static global variables (called when quitting anatomist)

◆ cleanup()

virtual void anatomist::AObject::cleanup ( )
protectedvirtual

must be called by objects destructors - Must be explicitly called by each object destructor since it can call virtual functions

Referenced by anatomist::ASurface< 3 >::notifyObservers().

◆ clearHasChangedFlags()

virtual void anatomist::AObject::clearHasChangedFlags ( ) const
virtual

Reset has-changed flags.

Must be called after a call to notifyObservers function to reset changes. This system is somewhat insuficient in fact: some observers don't need to update just now, and won't see the change later...

Reimplemented in anatomist::CutMesh, and anatomist::MObject.

◆ clearReferentialInheritance()

virtual void anatomist::AObject::clearReferentialInheritance ( )
protectedvirtual

sets the object to get referential from to null, unregister it

Reimplemented in anatomist::MObject.

◆ clone()

virtual AObject * anatomist::AObject::clone ( bool shallow = true)
virtual

Makes a copy of the object, with a duplicated object structure, palette and material, but which may share the underlying low-level data object (Aims object).

This is especially useful to show the same object with several palettes. This virtual method returns null by default if it is not overloaded.

Reimplemented in anatomist::AGraph, anatomist::ASparseMatrix, anatomist::ASurface< D >, anatomist::ASurface< 2 >, anatomist::ASurface< 3 >, anatomist::ASurface< 3 >, anatomist::ATexture, and anatomist::AVolume< T >.

References AObject().

◆ createDefaultPalette()

virtual void anatomist::AObject::createDefaultPalette ( const std::string & name = "")
virtual

function called by getOrCreatePalette() - overloadable, need not be called directly

Reimplemented in anatomist::AGraph, anatomist::ATexture, anatomist::VectorField, anatomist::VolRender, and anatomist::VolRenderShader.

References name().

◆ dimTexture()

virtual unsigned anatomist::AObject::dimTexture ( ) const
inlinevirtual

Number of texture values for a point.

Reimplemented in anatomist::ATexture, anatomist::AVolume< T >, and anatomist::Fusion2D.

Definition at line 350 of file Object.h.

◆ fallbackReferentialInheritance()

virtual AObject * anatomist::AObject::fallbackReferentialInheritance ( ) const
virtual

object to take referential from when no ref is assigned

Reimplemented in anatomist::CutMesh, anatomist::Fusion2D, anatomist::PlanarFusion3D, and anatomist::TesselatedMesh.

References AObject().

◆ fileName()

std::string anatomist::AObject::fileName ( ) const
inline

File name (if any) for loaded objects.

Definition at line 168 of file Object.h.

References _filename.

Referenced by anatomist::ASurface< D >::clone().

◆ GetMaterial()

◆ getObjectMenu()

static carto::rc_ptr< ObjectMenu > anatomist::AObject::getObjectMenu ( std::string type)
inlinestatic

Definition at line 469 of file Object.h.

References _objectmenu_map, and type().

◆ getObjectMenuMap()

static std::map< std::string, carto::rc_ptr< ObjectMenu > > & anatomist::AObject::getObjectMenuMap ( )
inlinestatic

Definition at line 474 of file Object.h.

References _objectmenu_map.

◆ getOrCreatePalette()

virtual const AObjectPalette * anatomist::AObject::getOrCreatePalette ( ) const
virtual

User normally calls this function.

◆ getReferential()

Referential * anatomist::AObject::getReferential ( ) const

◆ getTextureLabels()

virtual void anatomist::AObject::getTextureLabels ( const std::vector< float > & texvalues,
std::vector< std::string > & texlabels,
std::string & textype ) const
virtual

◆ glAPI() [1/2]

◆ glAPI() [2/2]

◆ hasReferenceChanged()

bool anatomist::AObject::hasReferenceChanged ( ) const

◆ hasTexture()

virtual bool anatomist::AObject::hasTexture ( ) const
inlinevirtual

Textured objects have values associated with a geometric coordinate.

Reimplemented in anatomist::AVolume< T >, anatomist::Fusion2D, and anatomist::Fusion3D.

Definition at line 348 of file Object.h.

◆ id()

int anatomist::AObject::id ( ) const
inline

Unique ID assigned upon construction, but somewhat unused now...

Definition at line 164 of file Object.h.

References _id.

◆ InMemory()

int anatomist::AObject::InMemory ( ) const
inline

For objects loading only when needed (not used yet...)

Definition at line 257 of file Object.h.

References _inMemory.

◆ internalUpdate()

virtual void anatomist::AObject::internalUpdate ( )
virtual

Updates the state of the object.

(when a part has changed and other parts depend on this change). Does nothing by default

Reimplemented in anatomist::AGraphObject, anatomist::AVolumeBase, and anatomist::Hierarchy.

◆ Is2DObject()

◆ Is3DObject()

◆ isCopy()

bool anatomist::AObject::isCopy ( ) const

◆ IsFusion2DAllowed()

virtual bool anatomist::AObject::IsFusion2DAllowed ( )
virtual

◆ isMultiObject()

virtual int anatomist::AObject::isMultiObject ( ) const
inlinevirtual

maybe not necessary ?: we can use dynamic_cast instead

Reimplemented in anatomist::MObject.

Definition at line 173 of file Object.h.

◆ isTransparent()

◆ load()

static std::list< AObject * > anatomist::AObject::load ( const std::string & filename)
static

Static object loader: creates an objects, loads its contents.

◆ loadable()

virtual bool anatomist::AObject::loadable ( ) const
inlinevirtual

◆ loadDate()

long anatomist::AObject::loadDate ( ) const

Time the object was created, loaded or reloaded.

◆ makeHeaderOptions()

virtual carto::Object anatomist::AObject::makeHeaderOptions ( ) const
virtual

get object properties into a generic object, such as material, palette etc before saving the object

Reimplemented in anatomist::ClippedObject, anatomist::CutMesh, and anatomist::Slice.

◆ material()

virtual const Material & anatomist::AObject::material ( ) const
inlinevirtual

◆ MaxT()

◆ MinT()

◆ mixedTexValue() [1/2]

virtual float anatomist::AObject::mixedTexValue ( const std::vector< float > & pos,
const Referential * orgRef,
int poly = -1 ) const
virtual

Gets a "mixed" texture value at a given space / time location.

The value is mixed, for multi-dimensional textures, according to an internal method (each object can use its own). Space coordinates are transformed from the incoming referential to the object's one.

Note: in Anatomist 4.4 and earlier, this method was taking an additional argument, org_voxel_size. This was kind of pointless since it more or less supposed that coordinates were passed in voxels rather in mm, which is wrong. In Anatomist 4.5 coords are officially always in mm.

Reimplemented in anatomist::Fusion2D.

References mixedTexValue().

Referenced by mixedTexValue().

◆ mixedTexValue() [2/2]

float anatomist::AObject::mixedTexValue ( const std::vector< float > & pos,
int poly = -1 ) const
inlinevirtual

Same as above except that coordinates are not transformed but taken in object coordinates system.

Reimplemented in anatomist::AVolume< T >, and anatomist::Fusion2D.

Definition at line 542 of file Object.h.

References texValues().

◆ mObjectAPI() [1/2]

virtual MObject * anatomist::AObject::mObjectAPI ( )
inlinevirtual

Reimplemented in anatomist::MObject.

Definition at line 155 of file Object.h.

◆ mObjectAPI() [2/2]

virtual const MObject * anatomist::AObject::mObjectAPI ( ) const
inlinevirtual

Reimplemented in anatomist::MObject.

Definition at line 154 of file Object.h.

◆ name()

◆ nearestVertex()

virtual const AObject * anatomist::AObject::nearestVertex ( const std::vector< float > & pos,
int * vertex,
float * distance,
float tol = -1,
int * polygon = 0,
bool tex_only = false,
int target_poly = -1 ) const
virtual

Get the nearest vertex to a given position.

Only valid for a mesh-based object, otherwise 0 is returned. vertex and distance should point to a valid int and float, and will be filled with the mesh vertex index, and the distance to this vertex. If the object has children objects, the child with the nearest vertex will be returned. If tol is >=0, this tolerence threshold is used to filter out vertices too far (thus the function may fail and return 0). If polygon is given as a valid pointer to an int, the polygon index of the "nearest polygon" will also be filled. The nearest polygon will contain the nearest vertex, thus a polygon wich center is nearest to the given point can be discarded.

The base implementation will perform an exaustive search, thus is costy. Optimized implementations could make use of a kdtree algorithm, but this default one does not.

If the object is also displayed in a 3D window, OpenGL-based functions may be more efficient than this one.

Reimplemented in anatomist::MObject.

References AObject().

◆ objectAt() [1/2]

virtual AObject * anatomist::AObject::objectAt ( const std::vector< float > & pos,
float tol,
const Referential * orgref,
const Point3df & orggeom )
virtual

Same with origin window referential.

References AObject().

◆ objectAt() [2/2]

virtual AObject * anatomist::AObject::objectAt ( const std::vector< float > & pos,
float tol = 0 )
virtual

Find the object (sub-object) at given postion with a tolerence.

Returns
0 if not found

Reimplemented in anatomist::AGraph, anatomist::ASurface< D >, anatomist::ASurface< 2 >, anatomist::ASurface< 3 >, anatomist::ASurface< 3 >, anatomist::ATexture, anatomist::AVolume< T >, anatomist::Bucket, and anatomist::MObject.

References AObject().

◆ objectFullTypeName()

virtual std::string anatomist::AObject::objectFullTypeName ( void ) const
inlinevirtual

Get Object Full Type Name.

It should be objectTypeName(_type) for most anatomist objects and completed with <T> for templated anatomist objects. For instance : AVolume<AimsRGBA>::objectFullTypeName() return : VOLUME<AimsRGBA>

Reimplemented in anatomist::AVolume< T >.

Definition at line 419 of file Object.h.

References _type, and objectTypeName().

Referenced by anatomist::ASurface< D >::optionTree().

◆ objectTypeName()

static std::string anatomist::AObject::objectTypeName ( int type)
static

References type().

Referenced by objectFullTypeName().

◆ optionMenu()

virtual ObjectMenu * anatomist::AObject::optionMenu ( ) const
virtual

◆ optionTree()

◆ palette() [1/2]

virtual AObjectPalette * anatomist::AObject::palette ( )
inlinevirtual

Normally, getOrCreatePalette() should be used instead of this function in most cases.

Reimplemented in anatomist::AGraphObject, anatomist::ClippedObject, anatomist::GLMObject, anatomist::Slice, anatomist::VectorField, anatomist::VolRender, and anatomist::VolRenderShader.

Definition at line 225 of file Object.h.

References _palette.

Referenced by setPalette().

◆ palette() [2/2]

virtual const AObjectPalette * anatomist::AObject::palette ( ) const
inlinevirtual

◆ Parents()

ParentList & anatomist::AObject::Parents ( )
inline

List of multi-objects containing this one. Obsolete: use parents()

Definition at line 262 of file Object.h.

References _parents.

◆ parents() [1/2]

ParentList & anatomist::AObject::parents ( )
inline

List of multi-objects containing this one.

Definition at line 264 of file Object.h.

References _parents.

Referenced by anatomist::Hierarchy::findNamedNode().

◆ parents() [2/2]

const ParentList & anatomist::AObject::parents ( ) const
inline

List of multi-objects containing this one.

Definition at line 266 of file Object.h.

References _parents.

◆ previousReferential()

const Referential * anatomist::AObject::previousReferential ( ) const

Referential that the object was in before the last change.

This function is only here to overcome a problem in the observer pattern, it is only used by observers that must react to a referential change

◆ primitives() [1/2]

PrimList & anatomist::AObject::primitives ( )
protected

◆ primitives() [2/2]

const PrimList & anatomist::AObject::primitives ( ) const
protected

◆ printTalairachCoord()

virtual bool anatomist::AObject::printTalairachCoord ( const Point3df & ,
const Referential *  ) const
inlinevirtual

should be replaced by a real referential

Reimplemented in anatomist::AVolume< T >.

Definition at line 428 of file Object.h.

◆ referentialInheritance()

AObject * anatomist::AObject::referentialInheritance ( ) const

if not null, the object referential is inherited from this object

References AObject().

◆ registerObjectType()

static int anatomist::AObject::registerObjectType ( const std::string & id)
static

Creates a new object type number and returns it.

◆ RegisterParent()

virtual void anatomist::AObject::RegisterParent ( MObject * pob)
inlinevirtual

Definition at line 267 of file Object.h.

References _parents.

◆ registerWindow()

virtual void anatomist::AObject::registerWindow ( AWindow * window)
virtual

◆ reload() [1/2]

static bool anatomist::AObject::reload ( AObject * object,
bool onlyoutdated = false )
static

Reads from disk again.

References AObject().

◆ reload() [2/2]

virtual bool anatomist::AObject::reload ( const std::string & filename)
virtual

Re-reads objects from disk.

Only called if loadable() is true and fileName() is not empty. A new filename can be passed to the reload function, so that files uncompressed by the ObjectReader in temporary locations can be processed. Overload this function in inherited classes to implement it.

If onlyoutdated is true, reloading will only be done if the files containing the object have been modified since the object has been created/loaded/saved

Reimplemented in anatomist::ASparseMatrix, anatomist::ASurface< D >, anatomist::ASurface< 2 >, anatomist::ASurface< 3 >, anatomist::ASurface< 3 >, anatomist::ATexture, anatomist::AVolume< T >, and anatomist::Bucket.

◆ render()

◆ renderingIsObserverDependent()

virtual bool anatomist::AObject::renderingIsObserverDependent ( ) const
virtual

true only if the rendering (openGL) of the object changes with the observer position/orientation of the view (which is rare, but typically needed for Volume Rendering)

Reimplemented in anatomist::MObject, anatomist::TransformedObject, anatomist::VolRender, and anatomist::VolRenderShader.

◆ savable()

◆ save() [1/2]

◆ save() [2/2]

bool anatomist::AObject::save ( const std::string & filename,
bool onlyIfModified )

◆ setAllowsOverwriteOnSave()

void anatomist::AObject::setAllowsOverwriteOnSave ( bool x)

◆ setCopyFlag()

void anatomist::AObject::setCopyFlag ( bool x = true)

◆ SetExtrema()

virtual void anatomist::AObject::SetExtrema ( )
inlinevirtual

Scans the object internals and determines its (texture) extrema values.

Reimplemented in anatomist::AVolume< T >, and anatomist::AVolumeView< T >.

Definition at line 346 of file Object.h.

◆ setFileName()

void anatomist::AObject::setFileName ( const std::string & filename)

◆ setGeomExtrema()

virtual void anatomist::AObject::setGeomExtrema ( )
inlinevirtual

Scans the object internals and determines its geometry extrema.

Reimplemented in anatomist::AGraph, and anatomist::Bucket.

Definition at line 344 of file Object.h.

◆ setHeaderOptions()

void anatomist::AObject::setHeaderOptions ( )

Set some object properties according to the header (.minf), such as material, palette etc.

Referenced by anatomist::ASurface< D >::setInternalsChanged(), anatomist::ASurface< D >::setSurface(), and anatomist::ASurface< D >::setSurface().

◆ setId()

void anatomist::AObject::setId ( int id)

◆ setInternalsChanged()

virtual void anatomist::AObject::setInternalsChanged ( )
virtual

Notifies some underlying lower-level objects have changed.

Useful especially after an underlying AIMS object has been modified

Reimplemented in anatomist::ASurface< D >, anatomist::ASurface< 2 >, anatomist::ASurface< 3 >, anatomist::ASurface< 3 >, anatomist::ATexture, anatomist::AVolume< T >, and anatomist::Bucket.

◆ setLoadDate()

void anatomist::AObject::setLoadDate ( long t)

◆ SetMaterial()

◆ setName()

void anatomist::AObject::setName ( const std::string & n)

◆ setObjectMenu()

static void anatomist::AObject::setObjectMenu ( std::string type,
carto::rc_ptr< ObjectMenu > om )
inlinestatic

Definition at line 465 of file Object.h.

References _objectmenu_map, and type().

Referenced by anatomist::ASurface< D >::optionTree().

◆ setPalette()

virtual void anatomist::AObject::setPalette ( const AObjectPalette & palette)
virtual

◆ setProperties()

virtual void anatomist::AObject::setProperties ( carto::Object options)
virtual

Same as setHeaderOptions() and used by it, allows passing a dictionary.

Reimplemented in anatomist::AGraph, anatomist::ClippedObject, anatomist::CutMesh, and anatomist::Slice.

◆ setReferenceChanged()

virtual void anatomist::AObject::setReferenceChanged ( )
virtual

◆ setReferential()

virtual void anatomist::AObject::setReferential ( Referential * ref)
virtual

Reimplemented in anatomist::MObject.

References carto::RCObject::ref.

◆ setReferentialInheritance()

virtual void anatomist::AObject::setReferentialInheritance ( AObject * ao)
virtual

Reimplemented in anatomist::MObject.

References AObject().

◆ setType()

void anatomist::AObject::setType ( int type)
inline

Method to set type id, because type() is not virtual.

Usefull when registering new AObject class from python.

Definition at line 162 of file Object.h.

References _type, and type().

◆ setUserModified()

void anatomist::AObject::setUserModified ( bool state = true)

if the object has been modified by user interaction, and needs saving

◆ SetVisibility()

void anatomist::AObject::SetVisibility ( int v)
inline

Definition at line 260 of file Object.h.

References _visible.

◆ setVoxelSize()

virtual void anatomist::AObject::setVoxelSize ( const std::vector< float > & )
inlinevirtual

◆ storeHeaderOptions()

virtual void anatomist::AObject::storeHeaderOptions ( )
virtual

Store some object properties into the header (.minf), such as material, palette etc before saving the object.

basically calls makeHeaderOptions() and stored them in the object header.

Referenced by anatomist::ASurface< D >::save().

◆ textured2D()

virtual bool anatomist::AObject::textured2D ( ) const
inlinevirtual

true if 2D rendering uses a textured plane (not a full openGL object)

Reimplemented in anatomist::AVolume< T >, anatomist::AVolumeView< T >, and anatomist::Fusion2D.

Definition at line 277 of file Object.h.

◆ texValues() [1/2]

virtual std::vector< float > anatomist::AObject::texValues ( const std::vector< float > & pos,
const Referential * orgRef,
int poly = -1 ) const
virtual

Gets the array of texture values at a given location.

The optional poly argument, added in anatomist 5.2, is a hint of the mesh polygon, when it is known (used for an OpenGL selection from a 3D window). If left to -1, exaustive search is performed using the nearestVertex() method. If a positive value is passed, only the vertices of that polygon will be inspected. An object-specific implementation may ignore this polygon information (like for a volume, for instance).

Note: in Anatomist 4.4 and earlier, this method was taking an additional argument, org_voxel_size. This was kind of pointless since it more or less supposed that coordinates were passed in voxels rather in mm, which is wrong. In Anatomist 4.5 coords are officially always in mm.

Reimplemented in anatomist::Fusion2D.

Referenced by mixedTexValue().

◆ texValues() [2/2]

virtual std::vector< float > anatomist::AObject::texValues ( const std::vector< float > & pos,
int poly = -1 ) const
virtual

◆ texValuesSeries() [1/2]

virtual carto::rc_ptr< carto::Volume< float > > anatomist::AObject::texValuesSeries ( const std::vector< float > & pos,
int axis,
const Referential * orgRef,
int poly = -1 ) const
virtual

◆ texValuesSeries() [2/2]

virtual carto::rc_ptr< carto::Volume< float > > anatomist::AObject::texValuesSeries ( const std::vector< float > & pos,
int axis,
int poly = -1 ) const
virtual

◆ toolTip()

virtual std::string anatomist::AObject::toolTip ( ) const
virtual

tooltip displayed in 3D views (HTML).

The default impementation returns an empty string, and the default tooltip will be displayed (see QAViewToolTip)

◆ type()

◆ unregisterObservable()

virtual void anatomist::AObject::unregisterObservable ( Observable * )
protectedvirtual

Called when an observable is destroyed, only called by Observable: don't use this function directly.

Reimplemented from anatomist::Observer.

Reimplemented in anatomist::Fusion2D.

References anatomist::Observer::Observable.

◆ UnregisterParent()

virtual void anatomist::AObject::UnregisterParent ( MObject * pob)
inlinevirtual

Definition at line 268 of file Object.h.

References _parents.

◆ unregisterWindow()

virtual void anatomist::AObject::unregisterWindow ( AWindow * window)
virtual

◆ update()

virtual void anatomist::AObject::update ( const Observable * observable,
void * arg )
virtual

◆ userModified()

bool anatomist::AObject::userModified ( ) const

if the object has been modified by user interaction, and needs saving

◆ Visible()

int anatomist::AObject::Visible ( ) const
inline

Visibility in control window.

Definition at line 259 of file Object.h.

References _visible.

◆ voxelSize()

◆ WinList()

const std::set< AWindow * > & anatomist::AObject::WinList ( )
inline

List of windows showing this object.

Definition at line 270 of file Object.h.

References _winList.

Friends And Related Symbol Documentation

◆ StaticInitializers

friend class StaticInitializers
friend

Definition at line 531 of file Object.h.

References StaticInitializers.

Referenced by StaticInitializers.

Member Data Documentation

◆ _filename

std::string anatomist::AObject::_filename
protected

Definition at line 505 of file Object.h.

Referenced by fileName().

◆ _id

int anatomist::AObject::_id
protected

Definition at line 503 of file Object.h.

Referenced by id().

◆ _inMemory

int anatomist::AObject::_inMemory
protected

Definition at line 508 of file Object.h.

Referenced by InMemory().

◆ _material

Material anatomist::AObject::_material
protected

Should be a pointer: some objects don't have a material (2D objects)

Definition at line 513 of file Object.h.

Referenced by GetMaterial().

◆ _name

std::string anatomist::AObject::_name
protected

Definition at line 504 of file Object.h.

Referenced by name().

◆ _objectmenu_map

std::map<std::string, carto::rc_ptr<ObjectMenu> > anatomist::AObject::_objectmenu_map
staticprotected

Object Menu Map.

Definition at line 529 of file Object.h.

Referenced by getObjectMenu(), getObjectMenuMap(), and setObjectMenu().

◆ _objectTypeNames

std::map<int,std::string> anatomist::AObject::_objectTypeNames
staticprotected

type-to-name map

Definition at line 525 of file Object.h.

◆ _objectTypes

std::map<std::string, int> anatomist::AObject::_objectTypes
staticprotected

name-to-type map

Definition at line 523 of file Object.h.

◆ _palette

AObjectPalette* anatomist::AObject::_palette
mutableprotected

Palette.

Definition at line 520 of file Object.h.

Referenced by palette(), and palette().

◆ _parents

ParentList anatomist::AObject::_parents
protected

Definition at line 510 of file Object.h.

Referenced by Parents(), parents(), parents(), RegisterParent(), and UnregisterParent().

◆ _referenceHasChanged

bool anatomist::AObject::_referenceHasChanged
mutableprotected

Reference has-changed flag.

Definition at line 517 of file Object.h.

◆ _referential

Referential* anatomist::AObject::_referential
protected

Referentiel.

Definition at line 515 of file Object.h.

◆ _type

int anatomist::AObject::_type
protected

Should be static in each object class.

Definition at line 502 of file Object.h.

Referenced by anatomist::ASurface< 3 >::glNumVertex(), objectFullTypeName(), setType(), and type().

◆ _visible

int anatomist::AObject::_visible
protected

Definition at line 509 of file Object.h.

Referenced by SetVisibility(), and Visible().

◆ _winList

std::set<AWindow*> anatomist::AObject::_winList
protected

Definition at line 507 of file Object.h.

Referenced by WinList().


The documentation for this class was generated from the following file: