BREP_FACET Class Reference

#include <Brep.h>

Collaboration diagram for BREP_FACET:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 BREP_FACET (BREP_SHELL *pr_shell)
virtual ~BREP_FACET ()
void CloseData ()
void ConnectContour (BREP_CONTOUR *contour)
void DisconnectContour (BREP_CONTOUR *contour)
void ComputePlaneEquation ()

Public Attributes

BREP_SHELLshell
BREP_CONTOUR_LIST outer_contours
Vector< double > normal
RBound< double > rbound
double d
 定数,原点から平面への距離*(-1)
double tolerance
bool deletable
 削除できる
bool notdelete
 削除してはいけない

Detailed Description

Definition at line 137 of file Brep.h.


Constructor & Destructor Documentation

BREP_FACET ( BREP_SHELL pr_shell  ) 

Definition at line 225 of file Brep.cpp.

References BREP_SHELL::ConnectFacet(), BREP_FACET::deletable, jbxl::Facet_Tolerance, BREP_FACET::notdelete, BREP_FACET::rbound, RBound< T >::set(), BREP_FACET::shell, and BREP_FACET::tolerance.

00226 {
00227     shell = pr_shell;
00228     if (shell!=NULL) shell->ConnectFacet(this);
00229     
00230     deletable = false; 
00231     notdelete = false;
00232     tolerance = Facet_Tolerance;
00233     
00234     rbound.set(HUGE_VALF, -HUGE_VALF, HUGE_VALF, -HUGE_VALF, HUGE_VALF, -HUGE_VALF);
00235 }

Here is the call graph for this function:

~BREP_FACET (  )  [virtual]

Definition at line 239 of file Brep.cpp.

References BREP_SHELL::DisconnectFacet(), BREP_CONTOUR::facet, BREP_FACET::outer_contours, and BREP_FACET::shell.

00240 {
00241     if (shell!=NULL) shell->DisconnectFacet(this);
00242 
00243     BREP_CONTOUR* bpcn;
00244     BREP_CONTOUR_LIST::iterator icon = outer_contours.begin();
00245     while (icon!=outer_contours.end()) {
00246         bpcn = *icon;
00247         icon = outer_contours.erase(icon);
00248         bpcn->facet = NULL;
00249         delete (bpcn);
00250     }
00251 }

Here is the call graph for this function:


Member Function Documentation

void CloseData ( void   ) 

Definition at line 255 of file Brep.cpp.

References BREP_FACET::ComputePlaneEquation(), and BREP_FACET::outer_contours.

Referenced by jbxl::PatchupContour(), and jbxl::ReverseContours().

00256 {
00257     BREP_CONTOUR_LIST::iterator icon;
00258     for (icon=outer_contours.begin(); icon!=outer_contours.end(); icon++) (*icon)->CloseData();
00259 
00260     ComputePlaneEquation();
00261 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ComputePlaneEquation (  ) 

void BREP_FACET::ComputePlaneEquation()

Note:
平面の方程式 N・P+d = 0 (N:法線ベクトル,P:平面の点の位置ベクトル,d:定数,原点から平面への距離x-1)

Definition at line 296 of file Brep.cpp.

References BREP_FACET::d, jbxl::Facet_Tolerance, Max, BREP_FACET::normal, BREP_FACET::outer_contours, BREP_FACET::rbound, BREP_FACET::tolerance, RBound< T >::xmax, RBound< T >::xmin, RBound< T >::ymax, RBound< T >::ymin, RBound< T >::zmax, and RBound< T >::zmin.

Referenced by BREP_FACET::CloseData().

00297 {
00298     normal = outer_contours.front()->normal;
00299 
00300     double emax =  0.0;
00301     double dmin =  HUGE_VALF;
00302     double dmax = -HUGE_VALF;
00303 
00304     BREP_CONTOUR_LIST::iterator icon;
00305     for (icon=outer_contours.begin(); icon!=outer_contours.end(); icon++) {
00306         (*icon)->CloseFacet(this, emax, dmin, dmax);
00307     }
00308 
00309     d = (dmin + dmax)/2.0;
00310     tolerance = Max((dmax - dmin)/2.0, Facet_Tolerance);
00311     tolerance = Max(emax, tolerance);
00312     
00313     double extent = tolerance + emax;
00314     rbound.xmin -= extent;
00315     rbound.ymin -= extent;
00316     rbound.zmin -= extent;
00317     rbound.xmax += extent;
00318     rbound.ymax += extent;
00319     rbound.zmax += extent;
00320 }

Here is the caller graph for this function:

void ConnectContour ( BREP_CONTOUR contour  ) 

Definition at line 266 of file Brep.cpp.

References BREP_CONTOUR::facet, and BREP_FACET::outer_contours.

Referenced by BREP_CONTOUR::BREP_CONTOUR().

00267 {
00268     if (contour!=NULL) {
00269         contour->facet = this;
00270         outer_contours.push_back(contour);
00271     }
00272 }

Here is the caller graph for this function:

void DisconnectContour ( BREP_CONTOUR contour  ) 

Definition at line 276 of file Brep.cpp.

References BREP_CONTOUR::facet, and BREP_FACET::outer_contours.

Referenced by BREP_CONTOUR::~BREP_CONTOUR().

00277 {
00278     if (contour!=NULL) {
00279         BREP_CONTOUR_LIST::iterator icon;
00280         icon = std::find(outer_contours.begin(), outer_contours.end(), contour);
00281         if (icon!=outer_contours.end()) outer_contours.erase(icon);
00282 
00283         contour->facet = NULL;
00284     }
00285 }

Here is the caller graph for this function:


Member Data Documentation

double d

Definition at line 146 of file Brep.h.

Referenced by BREP_FACET::ComputePlaneEquation().

bool deletable
Vector<double> normal

Definition at line 143 of file Brep.h.

Referenced by BREP_CONTOUR::CloseFacet(), and BREP_FACET::ComputePlaneEquation().

bool notdelete

Definition at line 150 of file Brep.h.

Referenced by BREP_FACET::BREP_FACET().

RBound<double> rbound
double tolerance

Definition at line 147 of file Brep.h.

Referenced by BREP_FACET::BREP_FACET(), and BREP_FACET::ComputePlaneEquation().


The documentation for this class was generated from the following files:

Generated on 15 Nov 2023 for JunkBox_Lib++ (for Windows) by  doxygen 1.6.1