Home | Doxygen Documentation | Tutorials | Developer Tools (restricted)

app-heier/meshes/oneQuad.hh
Go to the documentation of this file.
00001 #include "oneQuad.hh"
00002 #include "basics/exceptions.hh"
00003 
00004 namespace concepts{
00005 
00006 
00007   OneQuad::OneQuad(){
00008     Array<uint> attrib(4,0);
00009     construct_(attrib);
00010   }
00011 
00012 
00013   OneQuad::OneQuad(Array<uint> attrib){
00017     attrib.resize(4);
00018     construct_(attrib);
00019   }
00020 
00021   void OneQuad::construct_(const Array<uint>& attrib){
00022     for (uint i = 0; i < 4; i++)
00023       vtx_[i] =  new Vertex;
00024     
00025     //TODO 4, 5 ???
00026     conceptsAssert(attrib.size() >= 4, Assertion());
00027     
00028     edg_[0] = new Edge(*vtx_[0], *vtx_[1], attrib[0]);
00029     edg_[1] = new Edge(*vtx_[1], *vtx_[2], attrib[1]);
00030     edg_[2] = new Edge(*vtx_[2], *vtx_[3], attrib[2]);
00031     edg_[3] = new Edge(*vtx_[3], *vtx_[0], attrib[3]);
00032 
00033     quad_[0] = new Quad(*edg_[0], *edg_[1],*edg_[2],*edg_[3]);
00034 
00035     Array<Real2d> coord(4);
00036     coord[0] = Real2d(0,0);
00037     coord[1] = Real2d(1,0);
00038     coord[2] = Real2d(1,1);
00039     coord[3] = Real2d(0,1);
00040 
00041     cell_[0] = new Quad2d(*quad_[0], BlendingQuad2d(0,0,0,0,&coord[0],&coord[1],&coord[2],&coord[3]));
00042 
00043   }
00044 
00045   OneQuad::~OneQuad(){
00046     delete cell_[0];
00047     delete quad_[0];
00048     for (uint i = 0; i < 4; ++i) delete edg_[i];
00049     for (uint i = 0; i < 4; ++i) delete vtx_[i];
00050   }
00051 
00052 
00053   std::ostream& OneQuad::info(std::ostream& os) const {
00054     
00055     os << "OneQuad(";
00056     os << "area: " << *quad_[0] << ", "
00057        << ", cell: " << *cell_[0] <<")";
00058 
00059     return os;
00060   }
00061 
00062 }

Home | Doxygen Documentation | Tutorials | Developer Tools (restricted)