http://www.coin3d.org/
http://www.kongsberg.com/kogt/
Main Page
Classes
Files
File List
include
dime
entities
Block.h
1
/**************************************************************************\
2
* Copyright (c) Kongsberg Oil & Gas Technologies AS
3
* All rights reserved.
4
*
5
* Redistribution and use in source and binary forms, with or without
6
* modification, are permitted provided that the following conditions are
7
* met:
8
*
9
* Redistributions of source code must retain the above copyright notice,
10
* this list of conditions and the following disclaimer.
11
*
12
* Redistributions in binary form must reproduce the above copyright
13
* notice, this list of conditions and the following disclaimer in the
14
* documentation and/or other materials provided with the distribution.
15
*
16
* Neither the name of the copyright holder nor the names of its
17
* contributors may be used to endorse or promote products derived from
18
* this software without specific prior written permission.
19
*
20
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24
* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
\**************************************************************************/
32
33
#ifndef DIME_BLOCK_H
34
#define DIME_BLOCK_H
35
36
#include <dime/Basic.h>
37
#include <dime/entities/Entity.h>
38
#include <dime/util/Linear.h>
39
40
class
dimeInput
;
41
class
dimeMemHandler
;
42
class
dimeModel
;
43
class
dimeOutput
;
44
45
class
DIME_DLL_API
dimeBlock
:
public
dimeEntity
46
{
47
friend
class
dimeBlocksSection
;
48
friend
class
dimeEntitiesSection
;
49
friend
class
dimeInsert
;
50
friend
class
dimeModel
;
51
52
public
:
53
dimeBlock
(
dimeMemHandler
*
const
memhandler);
54
virtual
~
dimeBlock
();
55
56
const
dimeVec3f
&getBasePoint()
const
;
57
void
setBasePoint(
const
dimeVec3f
&v);
58
int
getNumEntities()
const
;
59
dimeEntity
*getEntity(
const
int
idx);
60
void
insertEntity(
dimeEntity
*
const
entity,
const
int
idx = -1);
61
void
removeEntity(
const
int
idx,
const
bool
deleteIt =
true
);
62
void
fitEntities();
63
64
const
char
*getName()
const
;
65
void
setName(
const
char
*
const
name);
66
67
dimeEntity
*
copy
(
dimeModel
*
const
model)
const
;
68
virtual
bool
getRecord
(
const
int
groupcode,
69
dimeParam
¶m,
70
const
int
index = 0)
const
;
71
virtual
const
char
*
getEntityName
()
const
;
72
73
virtual
bool
read
(
dimeInput
*
const
in);
74
virtual
bool
write
(
dimeOutput
*
const
out);
75
virtual
int
typeId
()
const
;
76
virtual
int
countRecords
()
const
;
77
78
protected
:
79
virtual
bool
handleRecord
(
const
int
groupcode,
80
const
dimeParam
& param,
81
dimeMemHandler
*
const
memhandler);
82
83
virtual
void
fixReferences
(
dimeModel
*
const
model);
84
virtual
bool
traverse
(
const
dimeState
*
const
state,
85
dimeCallback callback,
86
void
*userdata);
87
88
private
:
89
int16 flags;
90
const
char
*name;
91
dimeVec3f
basePoint;
92
dimeArray <dimeEntity*>
entities;
93
dimeEntity
*endblock;
94
dimeMemHandler
*memHandler;
95
96
};
// class dimeBlock
97
98
inline
const
dimeVec3f
&
99
dimeBlock::getBasePoint
()
const
100
{
101
return
this->basePoint;
102
}
103
104
inline
void
105
dimeBlock::setBasePoint
(
const
dimeVec3f
&v)
106
{
107
this->basePoint = v;
108
}
109
110
inline
int
111
dimeBlock::getNumEntities
()
const
112
{
113
return
this->entities.
count
();
114
}
115
116
inline
dimeEntity
*
117
dimeBlock::getEntity
(
const
int
idx)
118
{
119
assert(idx >= 0 && idx < this->entities.
count
());
120
return
this->entities[idx];
121
}
122
123
inline
const
char
*
124
dimeBlock::getName
()
const
125
{
126
return
this->name;
127
}
128
129
inline
void
130
dimeBlock::setName
(
const
char
*
const
name)
131
{
132
this->name = name;
133
}
134
135
#endif // ! DIME_BLOCK_H
136
Copyright © by
Kongsberg Oil & Gas Technologies
. All rights reserved.
Generated on Tue Nov 18 2014 14:22:40 for Dime by
Doxygen
1.8.1.2.