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. More...
 
void getLayerNames (std::vector< std::string > &names) const
 Gets all the layer names. More...
 
OgOGroup & group () const
 Returns a reference to the OgOGroup. More...
 
const File::Layerlayer (const std::string &name) const
 Finds a layer. More...
 
 Partition ()
 Ctor. More...
 
void setGroup (boost::shared_ptr< OgOGroup > ptr)
 Sets the group pointer. More...
 
From RefBase
virtual std::string className () const
 
- Public Member Functions inherited from RefBase
void ref () const
 Used by boost::intrusive_pointer. More...
 
size_t refcnt ()
 Used by boost::intrusive_pointer. More...
 
void unref () const
 Used by boost::intrusive_pointer. More...
 
WeakPtr weakPtr () const
 
 RefBase ()
 
 RefBase (const RefBase &)
 Copy constructor. More...
 
RefBaseoperator= (const RefBase &)
 Assignment operator. More...
 
virtual ~RefBase ()
 Destructor. More...
 
virtual bool checkRTTI (const char *typenameStr)=0
 This function is only implemented by concrete classes and triggers the actual RTTI check through matchRTTI();. More...
 
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. More...
 

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. More...
 
std::string name
 Name of the partition. More...
 

Private Types

typedef RefBase base
 Convenience typedef for referring to base class. More...
 

Private Attributes

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

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

typedef std::vector<Layer> File::Partition::LayerList

Definition at line 125 of file Field3DFile.h.

◆ Ptr

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

Definition at line 127 of file Field3DFile.h.

◆ CPtr

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

Definition at line 128 of file Field3DFile.h.

◆ class_type

Definition at line 132 of file Field3DFile.h.

◆ base

typedef RefBase File::Partition::base
private

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  { }

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 }

◆ 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 }

◆ 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 }

◆ 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 }

◆ 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 }

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.

◆ 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.

◆ m_group

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

Group representing the partition.

Definition at line 186 of file Field3DFile.h.


The documentation for this class was generated from the following files:
RefBase::RefBase
RefBase()
Definition: RefCount.h:120
File::Partition::name
std::string name
Name of the partition.
Definition: Field3DFile.h:175
File::Partition::layer
const File::Layer * layer(const std::string &name) const
Finds a layer.
Definition: Field3DFile.cpp:359
File::Partition::m_layers
LayerList m_layers
The layers belonging to this partition.
Definition: Field3DFile.h:184
File::Partition::m_group
boost::shared_ptr< OgOGroup > m_group
Group representing the partition.
Definition: Field3DFile.h:186