Navigation

Main Page
Download
Support
Installation
Tutorial
Examples
Reference Manual
   Version 1.0.6dev
      Class Index
      File List
   Version 1.0.6
   Version 1.0.5new_solver
   Version 1.0.5dev
   Version 1.0.5b
   Version 1.0.4dev
   Version 1.0.4
Publications


Hosted by Get Ion Beam Simulator at SourceForge.net. Fast, secure and Free Open Source software downloads
mydxftables.hpp
Go to the documentation of this file.
1 
5 /* Copyright (c) 2010-2012 Taneli Kalvas. All rights reserved.
6  *
7  * You can redistribute this software and/or modify it under the terms
8  * of the GNU General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * This library is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this library (file "COPYING" included in the package);
19  * if not, write to the Free Software Foundation, Inc., 51 Franklin
20  * Street, Fifth Floor, Boston, MA 02110-1301 USA
21  *
22  * If you have questions about your rights to use or distribute this
23  * software, please contact Berkeley Lab's Technology Transfer
24  * Department at TTD@lbl.gov. Other questions, comments and bug
25  * reports should be sent directly to the author via email at
26  * taneli.kalvas@jyu.fi.
27  *
28  * NOTICE. This software was developed under partial funding from the
29  * U.S. Department of Energy. As such, the U.S. Government has been
30  * granted for itself and others acting on its behalf a paid-up,
31  * nonexclusive, irrevocable, worldwide license in the Software to
32  * reproduce, prepare derivative works, and perform publicly and
33  * display publicly. Beginning five (5) years after the date
34  * permission to assert copyright is obtained from the U.S. Department
35  * of Energy, and subject to any subsequent five (5) year renewals,
36  * the U.S. Government is granted for itself and others acting on its
37  * behalf a paid-up, nonexclusive, irrevocable, worldwide license in
38  * the Software to reproduce, prepare derivative works, distribute
39  * copies to the public, perform publicly and display publicly, and to
40  * permit others to do so.
41  */
42 
43 #ifndef MY_DXF_TABLES_HPP
44 #define MY_DXF_TABLES_HPP 1
45 
46 
47 #include <vector>
48 #include <string>
49 #include <stdint.h>
50 #include "mydxffile.hpp"
51 
52 
56 {
57 
58  std::string _handle; // 5 (for others) or 105 (for DIMSTYLE)
59  std::string _handle_to_owner; // 330
60 
61 protected:
62 
66 
69  void process_group( class MyDXFFile *dxf );
70 
73  void write_common( class MyDXFFile *dxf, std::ofstream &ostr );
74 
77  void debug_print_common( std::ostream &os ) const;
78 
79 public:
80 
83  virtual ~MyDXFTableEntry() {};
84 
87  virtual void write( class MyDXFFile *dxf, std::ofstream &ostr ) = 0;
88 
91  virtual void debug_print( std::ostream &os ) const = 0;
92 
93  friend std::ostream &operator<<( std::ostream &os, const MyDXFTableEntry &e );
94 };
95 
96 
97 
101 {
102 
103  std::string _name; // 2
104  int16_t _units; // 70
105  int8_t _explodability; // 280
106  int8_t _scalability; // 281
107  std::string _handle_to_layout; // 340
108 
109 public:
110 
114 
117  virtual ~MyDXFTableEntryBlockRecord();
118 
121  virtual void write( class MyDXFFile *dxf, std::ofstream &ostr );
122 
125  virtual void debug_print( std::ostream &os ) const;
126 };
127 
128 
129 
133 {
134 
135  std::string _name; // 2
136  std::string _linetype; // 6
137  int16_t _flags; // 70
138  int16_t _color; // 62 (negative if layer off)
139  bool _plotting; // 290
140  int8_t _lineweight; // 370
141 
142  std::string _handle_to_plot_style_name; // 390
143  std::string _handle_to_material; // 347
144 
145 public:
146 
149  MyDXFTableEntryLayer( class MyDXFFile *dxf );
150 
153  virtual ~MyDXFTableEntryLayer();
154 
157  const std::string &name( void ) const { return( _name ); }
158 
161  void set_name( const std::string &name ) { _name = name; }
162 
165  virtual void write( class MyDXFFile *dxf, std::ofstream &ostr );
166 
169  virtual void debug_print( std::ostream &os ) const;
170 };
171 
172 
173 
177 {
178 
179  std::string _name; /* 2, Viewport name */
180  int16_t _flags; /* 70, Standard flag values (bit-coded values):
181  * 16 = If set, table entry is externally dependent on an xref
182  * 32 = If both this bit and bit 16 are set, the externally dependent xref has been successfully resolved
183  * 64 = If set, the table entry was referenced by at least one entity in the drawing the last time
184  * the drawing was edited. (This flag is for the benefit of AutoCAD commands. It can be ignored
185  * by most programs that read DXF files and does not need to be set by programs that write DXF
186  * files) */
187  Vec3D _vmin; /* 10, 20, Lower-left corner of viewport */
188  Vec3D _vmax; /* 11, 21, Upper-right corner of viewport */
189  Vec3D _vcenter; /* 12, 22, View center point (in DCS) */
190  Vec3D _snap_base; /* 13, 23, Snap base point (in DCS) */
191  Vec3D _snap_spacing; /* 14, 24, Snap spacing X and Y */
192  Vec3D _grid_spacing; /* 15, 25, Grid spacing X and Y */
193  Vec3D _view_direction; /* 16, 26, 36, View direction from target point (in WCS) */
194  Vec3D _view_target; /* 17, 27, 37, View target point (in WCS) */
195 
196  Vec3D _ucs_origin; /* 110, 120, 130, UCS origin */
197  Vec3D _ucs_x; /* 111, 121, 131, UCS x-axis */
198  Vec3D _ucs_y; /* 112, 122, 132, UCS y-axis */
199  int16_t _ucs_type; /* 79, Orthographic type of UCS
200  * 0 = UCS is not orthographic
201  * 1 = Top; 2 = Bottom
202  * 3 = Front; 4 = Back
203  * 5 = Left; 6 = Right */
204  double _elevation; /* 146, Elevation */
205 
206 public:
207 
210  MyDXFTableEntryVport( class MyDXFFile *dxf );
211 
214  virtual ~MyDXFTableEntryVport();
215 
218  virtual void write( class MyDXFFile *dxf, std::ofstream &ostr );
219 
222  virtual void debug_print( std::ostream &os ) const;
223 };
224 
225 
226 
230 {
231  std::string _name; // 2
232  std::string _handle; // 5
233  std::string _handle_to_owner; // 330
234 
235  std::vector<MyDXFTableEntry *> _entries; // 70 (size)
236 
237 public:
238 
239  MyDXFTable( const std::string &name, class MyDXFFile *dxf );
240  ~MyDXFTable();
241 
244  uint32_t size() const { return( _entries.size() ); }
245 
248  const MyDXFTableEntry *get_entry( uint32_t a ) const { return( _entries[a] ); }
249 
252  MyDXFTableEntry *get_entry( uint32_t a ) { return( _entries[a] ); }
253 
256  void write( class MyDXFFile *dxf, std::ofstream &ostr );
257 
260  void debug_print( std::ostream &os ) const;
261 };
262 
263 
264 
270 {
271 
272  MyDXFTable *_blockrecord;
273  MyDXFTable *_layer;
274  MyDXFTable *_vport;
275 
276 public:
277 
278  MyDXFTables( class MyDXFFile *dxf );
279  ~MyDXFTables();
280 
283  const MyDXFTable *get_layers_table( void ) const { return( _layer ); }
284 
287  MyDXFTable *get_layers_table( void ) { return( _layer ); }
288 
291  void write( class MyDXFFile *dxf, std::ofstream &ostr );
292 
295  void debug_print( std::ostream &os ) const;
296 };
297 
298 
299 #endif
DXF file class.
Definition: mydxffile.hpp:70
DXF table entry for block record table.
Definition: mydxftables.hpp:101
virtual void debug_print(std::ostream &os) const
Print debugging information to os.
Definition: mydxftables.cpp:147
virtual void write(class MyDXFFile *dxf, std::ofstream &ostr)
Write dxf file to stream.
Definition: mydxftables.cpp:131
virtual ~MyDXFTableEntryBlockRecord()
Virtual destructor.
Definition: mydxftables.cpp:125
MyDXFTableEntryBlockRecord(class MyDXFFile *dxf)
Construct entry by reading from DXF file.
Definition: mydxftables.cpp:99
DXF table entry for layer table.
Definition: mydxftables.hpp:133
const std::string & name(void) const
Return layer name.
Definition: mydxftables.hpp:157
virtual ~MyDXFTableEntryLayer()
Virtual destructor.
Definition: mydxftables.cpp:193
virtual void write(class MyDXFFile *dxf, std::ofstream &ostr)
Write dxf file to stream.
Definition: mydxftables.cpp:199
MyDXFTableEntryLayer(class MyDXFFile *dxf)
Construct entry by reading from DXF file.
Definition: mydxftables.cpp:161
void set_name(const std::string &name)
Return layer name.
Definition: mydxftables.hpp:161
virtual void debug_print(std::ostream &os) const
Print debugging information to os.
Definition: mydxftables.cpp:218
DXF table entry for vport table.
Definition: mydxftables.hpp:177
virtual void write(class MyDXFFile *dxf, std::ofstream &ostr)
Write dxf file to stream.
Definition: mydxftables.cpp:332
MyDXFTableEntryVport(class MyDXFFile *dxf)
Construct entry by reading from DXF file.
Definition: mydxftables.cpp:235
virtual ~MyDXFTableEntryVport()
Virtual destructor.
Definition: mydxftables.cpp:326
virtual void debug_print(std::ostream &os) const
Print debugging information to os.
Definition: mydxftables.cpp:375
DXF table entry.
Definition: mydxftables.hpp:56
virtual void debug_print(std::ostream &os) const =0
Print debugging information to os.
virtual void write(class MyDXFFile *dxf, std::ofstream &ostr)=0
Write dxf file to stream.
virtual ~MyDXFTableEntry()
Virtual destructor.
Definition: mydxftables.hpp:83
void write_common(class MyDXFFile *dxf, std::ofstream &ostr)
Write common groups.
Definition: mydxftables.cpp:70
void debug_print_common(std::ostream &os) const
Debug print common groups.
Definition: mydxftables.cpp:80
MyDXFTableEntry()
Constructor.
Definition: mydxftables.cpp:55
void process_group(class MyDXFFile *dxf)
Process group not belonging to the child entry.
Definition: mydxftables.cpp:61
DXF table class.
Definition: mydxftables.hpp:230
MyDXFTableEntry * get_entry(uint32_t a)
Return pointer to entry a.
Definition: mydxftables.hpp:252
uint32_t size() const
Return number of table entries.
Definition: mydxftables.hpp:244
void debug_print(std::ostream &os) const
Print debugging information to os.
Definition: mydxftables.cpp:464
void write(class MyDXFFile *dxf, std::ofstream &ostr)
Write dxf file to stream.
Definition: mydxftables.cpp:443
const MyDXFTableEntry * get_entry(uint32_t a) const
Return const pointer to entry a.
Definition: mydxftables.hpp:248
DXF tables class.
Definition: mydxftables.hpp:270
void write(class MyDXFFile *dxf, std::ofstream &ostr)
Write dxf file to stream.
Definition: mydxftables.cpp:548
void debug_print(std::ostream &os) const
Print debugging information to os.
Definition: mydxftables.cpp:566
const MyDXFTable * get_layers_table(void) const
Return const pointer to layers table.
Definition: mydxftables.hpp:283
MyDXFTable * get_layers_table(void)
Return pointer to layers table.
Definition: mydxftables.hpp:287
Three dimensional vector.
Definition: vec3d.hpp:58
DXF File.


Reference manual for Ion Beam Simulator 1.0.6dev
Generated by Doxygen 1.9.1 on Thu Sep 11 2025 09:37:24.