Line.h
1 /**************************************************************************\
2  *
3  * FILE: Line.h
4  *
5  * This source file is part of DIME.
6  * Copyright (C) 1998-1999 by Systems In Motion. All rights reserved.
7  *
8  * This library is free software; you can redistribute it and/or modify it
9  * under the terms of the GNU General Public License, version 2, as
10  * published by the Free Software Foundation.
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 (the accompanying file named COPYING) for more
16  * details.
17  *
18  **************************************************************************
19  *
20  * If you need DIME for a non-GPL project, contact Systems In Motion
21  * to acquire a Professional Edition License:
22  *
23  * Systems In Motion http://www.sim.no/
24  * Prof. Brochs gate 6 sales@sim.no
25  * N-7030 Trondheim Voice: +47 22114160
26  * NORWAY Fax: +47 67172912
27  *
28 \**************************************************************************/
29 
30 #ifndef DIME_LINE_H
31 #define DIME_LINE_H
32 
33 #include <dime/Basic.h>
34 #include <dime/entities/ExtrusionEntity.h>
35 #include <dime/util/Linear.h>
36 
37 class DIME_DLL_API dimeLine : public dimeExtrusionEntity
38 {
39 public:
40  dimeLine();
41 
42  const dimeVec3f &getCoords(const int idx) const;
43  void setCoords(const int idx, const dimeVec3f &v);
44 
45  virtual dimeEntity *copy(dimeModel * const model) const;
46  virtual bool getRecord(const int groupcode,
47  dimeParam &param,
48  const int index = 0) const;
49  virtual const char *getEntityName() const;
50  virtual void print() const;
51  virtual bool write(dimeOutput * const out);
52  virtual int typeId() const;
53  virtual int countRecords() const;
54 
55  virtual GeometryType extractGeometry(dimeArray <dimeVec3f> &verts,
56  dimeArray <int> &indices,
57  dimeVec3f &extrusionDir,
58  dxfdouble &thickness);
59 
60 protected:
61  virtual bool handleRecord(const int groupcode,
62  const dimeParam &param,
63  dimeMemHandler * const memhandler);
64 
65 private:
66  dimeVec3f coords[2];
67 
68 }; // class dimeLine
69 
70 inline const dimeVec3f &
71 dimeLine::getCoords(const int idx) const
72 {
73  assert(idx ==0 || idx == 1);
74  return this->coords[idx];
75 }
76 
77 inline void
78 dimeLine::setCoords(const int idx, const dimeVec3f &v)
79 {
80  assert(idx ==0 || idx == 1);
81  this->coords[idx] = v;
82 }
83 
84 #endif // ! DIME_LINE_H
85 
virtual int typeId() const
Definition: ExtrusionEntity.cpp:93
The dimeLine class handles a LINE entity.
Definition: Line.h:37
The dimeMemHandler class is a special-purpose memory manager.
Definition: MemHandler.h:35
virtual int countRecords() const
Definition: ExtrusionEntity.cpp:110
virtual dimeEntity * copy(dimeModel *const model) const =0
The dimeEntity class is the superclass of all entity classes.
Definition: Entity.h:57
The dimeModel class organizes a model.
Definition: Model.h:51
virtual const char * getEntityName() const =0
The dimeVec3f class is for containing and operating on a 3D vector / coordinate.
Definition: Linear.h:56
The dimeParam class is a union of the different parameter types.
Definition: Basic.h:97
The dimeExtrusionEntity class is the superclass of all entity classes with extrusion data...
Definition: ExtrusionEntity.h:35
virtual GeometryType extractGeometry(dimeArray< dimeVec3f > &verts, dimeArray< int > &indices, dimeVec3f &extrusionDir, dxfdouble &thickness)
Definition: Entity.cpp:577
virtual bool write(dimeOutput *const out)
Definition: Entity.cpp:267
The dimeOutput class handles writing of DXF and DXB files.
Definition: Output.h:38
virtual bool getRecord(const int groupcode, dimeParam &param, const int index=0) const
Definition: ExtrusionEntity.cpp:152
virtual bool handleRecord(const int groupcode, const dimeParam &param, dimeMemHandler *const memhandler)
Definition: ExtrusionEntity.cpp:132

Copyright © 1998-1999, Systems In Motion <sales@sim.no>. All rights reserved.
System documentation was generated using doxygen.