cgma
Lattice Class Reference

#include <geometry.hpp>

List of all members.

Public Member Functions

 Lattice ()
 Lattice (int dims, const Vector3d &v1_p, const Vector3d &v2_p, const Vector3d &v3_p, const FillNode &singleton_fill)
 Lattice (int dims, const Vector3d &v1_p, const Vector3d &v2_p, const Vector3d &v3_p, const Fill &full_fill)
 Lattice (const Lattice &l)
Latticeoperator= (const Lattice &l)
 ~Lattice ()
int numFiniteDirections () const
Transform getTxForNode (int x, int y, int z) const
const FillNodegetFillForNode (int x, int y, int z) const
bool isFixedSize () const
irange getXRange () const
irange getYRange () const
irange getZRange () const

Protected Attributes

int num_finite_dims
Vector3d v1
Vector3d v2
Vector3d v3
DataRef< Fill > * fill

Detailed Description

Definition at line 223 of file geometry.hpp.


Constructor & Destructor Documentation

Lattice::Lattice ( ) [inline]

Definition at line 232 of file geometry.hpp.

: fill(new NullRef<Fill>()){}
Lattice::Lattice ( int  dims,
const Vector3d v1_p,
const Vector3d v2_p,
const Vector3d v3_p,
const FillNode singleton_fill 
)

Definition at line 256 of file geometry.cpp.

                                                                                                                   : 
  num_finite_dims(dims), v1(v1_p), v2(v2_p), v3(v3_p), fill(new ImmediateRef<Fill>( Fill(node) ))
{}
Lattice::Lattice ( int  dims,
const Vector3d v1_p,
const Vector3d v2_p,
const Vector3d v3_p,
const Fill full_fill 
)

Definition at line 260 of file geometry.cpp.

                                                                                                                 :
  num_finite_dims(dims), v1(v1_p), v2(v2_p), v3(v3_p), fill(new PointerRef<Fill>(&fill_p) )
{}
Lattice::Lattice ( const Lattice l)

Definition at line 265 of file geometry.cpp.

                                   :
  num_finite_dims( l.num_finite_dims ), v1( l.v1 ), v2( l.v2 ), v3( l.v3 ), fill( l.fill->clone() )
{}
Lattice::~Lattice ( ) [inline]

Definition at line 238 of file geometry.hpp.

{ delete fill; }

Member Function Documentation

const FillNode & Lattice::getFillForNode ( int  x,
int  y,
int  z 
) const

Definition at line 300 of file geometry.cpp.

                                                                   {
  if( fill->getData().has_grid ){
    return fill->getData().getNode( x, y, z );
  }
  else{
    return fill->getData().getOriginNode();
  }
}
Transform Lattice::getTxForNode ( int  x,
int  y,
int  z 
) const

Definition at line 283 of file geometry.cpp.

                                                           {

  Vector3d v;
  switch( num_finite_dims ){
  case 3:
    v = v3 * z; // fallthrough
  case 2:
    v = v + v2 * y; // fallthrough
  case 1:
    v = v + v1 * x;
  default:
    break;
  }

  return Transform(v);
}
irange Lattice::getXRange ( ) const [inline]

Definition at line 247 of file geometry.hpp.

{ return fill->getData().xrange; }
irange Lattice::getYRange ( ) const [inline]

Definition at line 248 of file geometry.hpp.

{ return fill->getData().yrange; }
irange Lattice::getZRange ( ) const [inline]

Definition at line 249 of file geometry.hpp.

{ return fill->getData().zrange; }
bool Lattice::isFixedSize ( ) const [inline]

Definition at line 246 of file geometry.hpp.

{ return fill->getData().has_grid; }  
int Lattice::numFiniteDirections ( ) const [inline]

Definition at line 241 of file geometry.hpp.

{ return num_finite_dims; }
Lattice & Lattice::operator= ( const Lattice l)

Definition at line 269 of file geometry.cpp.

                                             {
  if( this != &l ){

    num_finite_dims = l.num_finite_dims;
    fill = l.fill->clone();
    v1 = l.v1;
    v2 = l.v2;
    v3 = l.v3;
    
  }
  return *this;
}

Member Data Documentation

DataRef<Fill>* Lattice::fill [protected]

Definition at line 229 of file geometry.hpp.

int Lattice::num_finite_dims [protected]

Definition at line 226 of file geometry.hpp.

Vector3d Lattice::v1 [protected]

Definition at line 227 of file geometry.hpp.

Vector3d Lattice::v2 [protected]

Definition at line 227 of file geometry.hpp.

Vector3d Lattice::v3 [protected]

Definition at line 227 of file geometry.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines