Field3D

#include <Field3DFile.h>

Inheritance diagram for File::Partition:
RefBase

Public Types

typedef Partition class_type
 
typedef boost::intrusive_ptr< const PartitionCPtr
 
typedef std::vector< LayerLayerList
 
typedef boost::intrusive_ptr< PartitionPtr
 
- Public Types inherited from RefBase
typedef boost::intrusive_ptr< RefBasePtr
 
typedef boost::weak_ptr< RefBaseWeakPtr
 

Public Member Functions

void addLayer (const File::Layer &layer)
 Adds a layer.
 
void getLayerNames (std::vector< std::string > &names) const
 Gets all the layer names.
 
OgOGroup & group () const
 Returns a reference to the OgOGroup.
 
const File::Layerlayer (const std::string &name) const
 Finds a layer.
 
 Partition ()
 Ctor.
 
void setGroup (boost::shared_ptr< OgOGroup > ptr)
 Sets the group pointer.
 
From RefBase
virtual std::string className () const
 
- Public Member Functions inherited from RefBase
void ref () const
 Used by boost::intrusive_pointer.
 
size_t refcnt ()
 Used by boost::intrusive_pointer.
 
void unref () const
 Used by boost::intrusive_pointer.
 
WeakPtr weakPtr () const
 
 RefBase ()
 
 RefBase (const RefBase &)
 Copy constructor.
 
RefBaseoperator= (const RefBase &)
 Assignment operator.
 
virtual ~RefBase ()
 Destructor.
 
virtual bool checkRTTI (const char *typenameStr)=0
 This function is only implemented by concrete classes and triggers the actual RTTI check through matchRTTI();.
 
bool matchRTTI (const char *typenameStr)
 Performs a check to see if the given typename string matches this class' This needs to be implemented in -all- subclasses, even abstract ones.
 

Static Public Member Functions

static const char * staticClassType ()
 
- Static Public Member Functions inherited from RefBase
static const char * staticClassType ()
 

Public Attributes

 DEFINE_FIELD_RTTI_CONCRETE_CLASS
 
FieldMapping::Ptr mapping
 Pointer to the mapping object.
 
std::string name
 Name of the partition.
 

Private Types

typedef RefBase base
 Convenience typedef for referring to base class.
 

Private Attributes

boost::shared_ptr< OgOGroup > m_group
 Group representing the partition.
 
LayerList m_layers
 The layers belonging to this partition.
 

Detailed Description

This class represents the partition-level node in a f3D file. The partition contains one "Mapping" and N "Fields" that all share that mapping.

Definition at line 121 of file Field3DFile.h.

Member Typedef Documentation

◆ LayerList

Definition at line 125 of file Field3DFile.h.

◆ Ptr

boost::intrusive_ptr<Partition> File::Partition::Ptr

Definition at line 127 of file Field3DFile.h.

◆ CPtr

boost::intrusive_ptr<const Partition> File::Partition::CPtr

Definition at line 128 of file Field3DFile.h.

◆ class_type

◆ base

Convenience typedef for referring to base class.

Definition at line 191 of file Field3DFile.h.

Constructor & Destructor Documentation

◆ Partition()

File::Partition::Partition ( )
inline

Ctor.

Definition at line 143 of file Field3DFile.h.

144 : RefBase()
145 { }
RefBase()
Definition RefCount.h:120

Member Function Documentation

◆ staticClassType()

static const char * File::Partition::staticClassType ( )
inlinestatic

Definition at line 135 of file Field3DFile.h.

136 {
137 return "Partition";
138 }

◆ className()

std::string File::Partition::className ( ) const
virtual

Definition at line 343 of file Field3DFile.cpp.

344{
345 return k_partitionName;
346}

◆ addLayer()

void File::Partition::addLayer ( const File::Layer & layer)

Adds a layer.

Definition at line 351 of file Field3DFile.cpp.

352{
353 m_layers.push_back(layer);
354}
LayerList m_layers
The layers belonging to this partition.
const File::Layer * layer(const std::string &name) const
Finds a layer.

References layer(), and m_layers.

◆ layer()

const Layer * File::Partition::layer ( const std::string & name) const

Finds a layer.

Definition at line 359 of file Field3DFile.cpp.

360{
361 for (LayerList::const_iterator i = m_layers.begin();
362 i != m_layers.end(); ++i) {
363 if (i->name == name) {
364 return &(*i);
365 }
366 }
367 return NULL;
368}
std::string name
Name of the partition.

References m_layers, and name.

Referenced by addLayer().

◆ getLayerNames()

void File::Partition::getLayerNames ( std::vector< std::string > & names) const

Gets all the layer names.

Definition at line 373 of file Field3DFile.cpp.

374{
375 // We don't want to do names.clear() here, since this gets called
376 // inside some loops that want to accumulate names.
377 for (LayerList::const_iterator i = m_layers.begin();
378 i != m_layers.end(); ++i) {
379 names.push_back(i->name);
380 }
381}

References m_layers.

◆ group()

OgOGroup & File::Partition::group ( ) const

Returns a reference to the OgOGroup.

Definition at line 385 of file Field3DFile.cpp.

386{
387 return *m_group;
388}
boost::shared_ptr< OgOGroup > m_group
Group representing the partition.

References m_group.

◆ setGroup()

void File::Partition::setGroup ( boost::shared_ptr< OgOGroup > ptr)

Sets the group pointer.

Definition at line 392 of file Field3DFile.cpp.

393{
394 m_group = ptr;
395}

References m_group.

Member Data Documentation

◆ DEFINE_FIELD_RTTI_CONCRETE_CLASS

File::Partition::DEFINE_FIELD_RTTI_CONCRETE_CLASS

Definition at line 133 of file Field3DFile.h.

◆ name

std::string File::Partition::name

Name of the partition.

Definition at line 175 of file Field3DFile.h.

Referenced by layer().

◆ mapping

FieldMapping::Ptr File::Partition::mapping

Pointer to the mapping object.

Definition at line 177 of file Field3DFile.h.

◆ m_layers

LayerList File::Partition::m_layers
private

The layers belonging to this partition.

Definition at line 184 of file Field3DFile.h.

Referenced by addLayer(), getLayerNames(), and layer().

◆ m_group

boost::shared_ptr<OgOGroup> File::Partition::m_group
private

Group representing the partition.

Definition at line 186 of file Field3DFile.h.

Referenced by group(), and setGroup().


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