00001
00002
00003
00004
00005
00006 #include "geomrep/BoxRep.h"
00007
00008 #include "geometry/Hexahedron.h"
00009
00010 BoxRep::BoxRep(const Shape& shape)
00011 : m_box( dynamic_cast<const Hexahedron& >(shape) )
00012 {};
00013
00014
00015 void BoxRep::update()
00016 {
00017 const int lines[]=
00018 { 0,2,3,1,0,
00019 4,6,7,5,4, -1,
00020 2,6,-1,
00021 3,7,-1,
00022 1,5,-1
00023 };
00024
00025 for(int i=0; i<8; i++) {
00026 addVertex(m_box.vertex(i));
00027 }
00028
00029 indexedLineSet(lines, sizeof(lines)/sizeof(int));
00030 }
00031
00032