box_face< C, V > Struct Template Reference

#include <box_face.hpp>

List of all members.

Public Types

Public Member Functions

Public Attributes


Detailed Description

template<class C, class V>
struct mmx::shape::box_face< C, V >

Definition at line 16 of file box_face.hpp.


Member Typedef Documentation

typedef bounding_box<C,V> BoundingBox

Definition at line 18 of file box_face.hpp.

typedef vertex<C,3,V> Point

Definition at line 17 of file box_face.hpp.


Constructor & Destructor Documentation

box_face (  )  [inline]

Definition at line 19 of file box_face.hpp.

References box_face< C, V >::m_s, box_face< C, V >::m_v, and box_face< C, V >::m_var.

00019                  {
00020         m_v<<2;m_s<<0;m_var<<0<<1;
00021       }

box_face ( int  v1,
int  i1 
) [inline]

Definition at line 22 of file box_face.hpp.

References box_face< C, V >::m_s, box_face< C, V >::m_v, and box_face< C, V >::m_var.

00022                                {  
00023         m_v<<v1; m_s<<i1;
00024         switch(v1) {
00025         case 0:
00026           m_var<<1<<2;
00027         case 1:
00028           m_var<<0<<2;
00029         default:
00030           m_var<<0<<1;
00031         }
00032       }

box_face ( int  v1,
int  i1,
int  v2,
int  i2 
) [inline]

Definition at line 34 of file box_face.hpp.

References box_face< C, V >::m_s, box_face< C, V >::m_v, and box_face< C, V >::m_var.

00034                                                {
00035         m_v<<v1<<v2;
00036         m_s<<i1<<i2;
00037         m_var<<(3-v1-v2);
00038       }


Member Function Documentation

int cvar ( unsigned  i  )  const [inline]
int fvar ( unsigned  i  )  const [inline]

Definition at line 88 of file box_face.hpp.

References box_face< C, V >::m_var.

00088 { return m_var[i]; }

bool is_valid ( const Point p,
const BoundingBox bx,
double  eps = 0.000001 
) const [inline]

Definition at line 78 of file box_face.hpp.

References box_face< C, V >::m_s, and box_face< C, V >::m_v.

00078                                                                                         {
00079 
00080         if (m_s[0] ==0 && p[m_v[0]]<bx(m_v[0],0)-eps) return false;
00081         if (m_s[0] ==1 && p[m_v[0]]>bx(m_v[0],1)+eps) return false;
00082         return true;
00083       }

bool is_valid ( const BoundingBox bx,
double  u,
double  eps 
) const [inline]

Definition at line 56 of file box_face.hpp.

References box_face< C, V >::m_s, and box_face< C, V >::m_var.

Referenced by solver_implicit< C, V >::face_point().

00056                                                                            {
00057         if(m_var[0]==0) {
00058           //      return true;
00059           if (m_s[0]==0)
00060             return u-eps>(bx)(m_var[0],0);
00061           else
00062             return u+eps<(bx)(m_var[0],1);
00063         } else {
00064           if (m_s[0]==1)
00065             return u-eps>(bx)(m_var[0],0);
00066           else
00067             return u+eps<(bx)(m_var[0],1);
00068         }
00069       }

bool is_valid_scale ( double  u,
double  eps 
) const [inline]

Definition at line 71 of file box_face.hpp.

References box_face< C, V >::m_var.

00071                                                          {
00072         if(m_var[0]==0)
00073           return u-eps>0;
00074         else
00075           return u+eps<1;
00076       }

double lower ( const BoundingBox bx  )  const [inline]

Definition at line 90 of file box_face.hpp.

References box_face< C, V >::m_var.

Referenced by solver_implicit< C, V >::common_edge_point(), and solver_implicit< C, V >::edge_point().

00090                                                  { 
00091         return (bx)(m_var[0],0); 
00092       }

Point* new_point ( const BoundingBox bx,
double  u,
double  v 
) const [inline]

Definition at line 48 of file box_face.hpp.

References box_face< C, V >::m_s, box_face< C, V >::m_v, and box_face< C, V >::m_var.

00048                                                                          {
00049         double pt[3];
00050         pt[m_var[0]]= bx(m_var[0],0)+ u*(bx(m_var[0],1)-bx(m_var[0],0));        
00051         pt[m_var[1]]= bx(m_var[1],0)+ v*(bx(m_var[1],1)-bx(m_var[1],0));        
00052         pt[m_v[0]] = (bx)(m_v[0],m_s[0]);
00053         return new Point(pt[0],pt[1],pt[2], m_v[0]);
00054       }

Point* new_point ( const BoundingBox bx,
double  u 
) const [inline]

Definition at line 40 of file box_face.hpp.

References box_face< C, V >::m_s, box_face< C, V >::m_v, and box_face< C, V >::m_var.

Referenced by solver_implicit< C, V >::common_edge_point(), solver_implicit< C, V >::edge_point(), and solver_implicit< C, V >::face_point().

00040                                                                {
00041         double pt[3];
00042         pt[m_var[0]]= u;
00043         pt[m_v[0]] = (bx)(m_v[0],m_s[0]);
00044         pt[m_v[1]] = (bx)(m_v[1],m_s[1]);
00045         return new Point(pt[0],pt[1],pt[2]);
00046       }

int side ( unsigned  i  )  const [inline]
double upper ( const BoundingBox bx  )  const [inline]

Definition at line 93 of file box_face.hpp.

References box_face< C, V >::m_var.

Referenced by solver_implicit< C, V >::common_edge_point(), and solver_implicit< C, V >::edge_point().

00093                                                  { 
00094         return (bx)(m_var[0],1); 
00095       }


Member Data Documentation

Seq<int> m_s
Seq<int> m_v
Seq<int> m_var

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

Generated on 6 Dec 2012 for shape by  doxygen 1.6.1