zjf
2023-03-06 392b76515f40376b6d36f40a114850ef63650384
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
/////////////////////////////////////////////////////////////////////////////// 
// Copyright (C) 2002-2016, Open Design Alliance (the "Alliance"). 
// All rights reserved. 
// 
// This software and its documentation and related materials are owned by 
// the Alliance. The software may only be incorporated into application 
// programs owned by members of the Alliance, subject to a signed 
// Membership Agreement and Supplemental Software License Agreement with the
// Alliance. The structure and organization of this software are the valuable  
// trade secrets of the Alliance and its suppliers. The software is also 
// protected by copyright law and international treaty provisions. Application  
// programs incorporating this software must include the following statement 
// with their copyright notices:
//   
//   This application incorporates Teigha(R) software pursuant to a license 
//   agreement with Open Design Alliance.
//   Teigha(R) Copyright (C) 2002-2016 by Open Design Alliance. 
//   All rights reserved.
//
// By use of this software, its documentation or related materials, you 
// acknowledge and accept the above terms.
///////////////////////////////////////////////////////////////////////////////
 
 
#ifndef _OD_MODELERGEOMETRYCREATOR_INCLUDED_
#define _OD_MODELERGEOMETRYCREATOR_INCLUDED_
 
#include "RxObject.h"
#include "ModelerGeometry.h"
#include "OdArray.h"
 
class OdStreamBuf;
 
#include "TD_PackPush.h"
 
/** \details
    This utility class loads and saves SAT/SAB files, and performs other
    miscellaneous other ACIS-related operations.
    
    \remarks
    The functions in this class can do the following: 
    * Create OdModelerGeometry instances from a specified input stream.
    * Save SAT/SAB data from an OdModelerGeometry instance.
    * Create region entities from sets of curves.
 
    Library: ModelerGeometry
    <group Other_Classes>
*/
class TOOLKIT_EXPORT OdModelerGeometryCreator : public OdRxObject
{
protected:
  OdModelerGeometryCreator() {}
public:  
  ODRX_DECLARE_MEMBERS(OdModelerGeometryCreator);
 
  /** \details
      Creates one or more instances of OdModelerGeometry from the specified SAT/SAB file.
      
      \param models [out]  Receives an array of OdModelerGeometry SmartPointers.
      \param pStreamBuf [in]  Pointer to the StreamBuf object from which the data are to be read.   
      \param standardSaveFlag [in]  Controls the saving and restoring of use count data in the save file.
 
      \remarks
      Since OdModelerGeometry does not support multi-body SAT files, such files 
      are divided into a set of single body OdModelerGeometry objects
 
      Empty streamBuf generates single element array with empty OdModelerGeometry.
 
      Returns eOk if successful, or an appropriate error code if not.
  */
  virtual OdResult createModeler(OdArray<OdModelerGeometryPtr> &models, 
    OdStreamBuf* pStreamBuf, 
    bool standardSaveFlag = true) = 0;
 
  /** \details
    Creates a single SAT/SAB file from the specified array of objects.
 
    \param models [in]  Array of SmartPointers to the OdDbModelerGeometry objects to be written.
    \param pStreamBuf [in]  Pointer to the StreamBuf object to which the data are to be written.   
    \param typeVer [in] Type and version of ACIS data to write.
    \param standardSaveFlag [in] Controls the saving and restoring of use count data in the save file.
  */
  virtual OdResult createSat(const OdArray<OdModelerGeometryPtr> &models, 
    OdStreamBuf* pStreamBuf, 
    AfTypeVer typeVer, 
    bool standardSaveFlag = true) = 0;
 
  /** \param entities [in]  Array of SmartPointers to the OdDbEntity objects to be written.
    \remarks
    Color attributes are also added to the SAT/SAB file from the specified OdDbEntity objects.
    \returns
    Returns eOk if successful, or an appropriate error code if not.
    \note
    Only the following OdDbEntity types are valid: OdDb3dSolid, OdDbBody, and OdDbRegion/
  */
  virtual OdResult createSat(const OdDbEntityPtrArray &entities, 
    OdStreamBuf* pStreamBuf, 
    AfTypeVer typeVer, 
    bool standardSaveFlag = true) = 0;
 
  /** \details
    Creates OdDbRegion entities from the closed loops defined by the specified curve segments.
 
    \param curveSegments [in]  Array of curve segments.
    \param pRegions [out]  Receives an array of pointers to the regions.
 
    \remarks
    Each curve segment must be one of the following
 
    @untitled table
    OdDb3dPolyline
    OdDbArc
    OdDbCircle
    OdDbEllipse
    OdDbLine
    OdDbPolyline
    OdDbSpline
 
    The newly created regions are non- database -resident. It is up to the caller to either add them
    to an OdDbDatabase or to delete them.
 
    \returns 
    Returns eOk if successful, or an appropriate error code if not. 
    
    \remarks
    * All curves must be in the same plane.
    * The endpoint of each curve must be equal to the start point of the next curve
    * The endpoint of the last curve must be equal to the start point of the first curve.
    
  */
  virtual OdResult createRegionFromCurves(const OdRxObjectPtrArray& curveSegments, 
    OdArray<OdModelerGeometryPtr> &pRegions) = 0;
};
 
/** \details
    This template class is a specialization of the OdSmartPtr class for OdModelerGeometryCreator object pointers.
*/
typedef OdSmartPtr<OdModelerGeometryCreator> OdModelerGeometryCreatorPtr;
 
#include "TD_PackPop.h"
 
#endif // _OD_MODELERGEOMETRYCREATOR_INCLUDED_