1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
//-----------------------------------------------------------------------------
//
//  File: CubitPointData.hpp
//
//  Purpose:  Child class of CubitPoint.  It is the Cubit-specific version of
//            of the CubitPoint.
//
//  Notes:    Note that this class contains data which is accessed
//            virtually from CubitPoint.  In most cases, you can create
//            a CubitPointData and treat it as if it is a CubitPoint.
//            For example:
//               CubitPoint *cp = (CubitPoint *) new CubitPointData(...);
//            There should be no reason to reference the CubitFacetPoint 
//            directly.  This is done to allow different data representations
//            of a point in addition to that used by Cubit.
//                        
//-----------------------------------------------------------------------------


#ifndef CUBITPOINTDATA_HPP
#define CUBITPOINTDATA_HPP

// Include for CubitBoolean
#include "CubitDefines.h"
#include "CubitVector.hpp"
#include "DLIList.hpp"
#include "MemoryManager.hpp"
#include "ToolDataUser.hpp"
#include "CubitMatrix.hpp"
#include "CubitPoint.hpp"
class CubitFacet;

class CubitPointData : public CubitPoint
{
private:

  CubitVector coords;
  DLIList<CubitFacet*> *attachedFacets;

  static MemoryManager memoryManager;
    //- memory management object

  int entityId;

public:
  
  CubitPointData(double x_val, double y_val, double z_val );
  CubitPointData(double x_val, double y_val, double z_val,int *);
  CubitPointData( const CubitVector &new_point );
  ~CubitPointData();

  SetDynamicMemoryAllocation(memoryManager)
      //- class specific new and delete operators

  int id(){ return entityId;}
  void set_id( int new_id ) { entityId = new_id; }<--- Function in derived class<--- Function in derived class

  double x(){return coords.x();}<--- Function in derived class<--- Function in derived class
  double y(){return coords.y();}<--- Function in derived class<--- Function in derived class
  double z(){return coords.z();}<--- Function in derived class<--- Function in derived class
  void set( const CubitVector &pos ) { coords = pos; }<--- Function in derived class<--- Function in derived class

  void marked(int marked){ markedFlag = marked;}<--- Function in derived class<--- Function in derived class
  int marked(){return markedFlag;}<--- Function in derived class<--- Function in derived class
    //- generic marker for efficient sorting.
      
  CubitVector coordinates() const { return coords; }<--- Function in derived class<--- Function in derived class
  void coordinates(double point_array[3]);<--- Function in derived class<--- Function in derived class

  void add_facet( CubitFacet *facet);<--- Function in derived class<--- Function in derived class
  void remove_facet( CubitFacet *facet );<--- Function in derived class<--- Function in derived class
  int num_adj_facets();<--- Function in derived class<--- Function in derived class

  void facets( DLIList<CubitFacet*> &facet_list )<--- Function in derived class<--- Function in derived class
    { if (attachedFacets) facet_list += *attachedFacets; }
  void tris( DLIList<CubitFacet*> &facet_list ) <--- Function in derived class<--- Function in derived class
		{ facets(facet_list); }
  void edges( DLIList<CubitFacetEdge*> &edge_list );<--- Function in derived class<--- Function in derived class
  void points( DLIList<CubitPoint*> &point_list )<--- Function in derived class<--- Function in derived class
    { point_list.append( this ); }

  void compute_avg_normal();
  CubitStatus merge_points( CubitPoint *dead_point, CubitBoolean keep_point = CUBIT_FALSE );<--- Function in derived class<--- Function in derived class
  CubitStatus collapse_edge( CubitPointData *dead_point );
};

#endif