SmallChange  1.0.0
A collection of extensions to Coin3D
Loading...
Searching...
No Matches
SmWellLogKit.h
1#ifndef SMALLCHANGE_SMWELLLOGKIT_H
2#define SMALLCHANGE_SMWELLLOGKIT_H
3
4/**************************************************************************\
5 * Copyright (c) Kongsberg Oil & Gas Technologies AS
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions are
10 * met:
11 *
12 * Redistributions of source code must retain the above copyright notice,
13 * this list of conditions and the following disclaimer.
14 *
15 * Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 *
19 * Neither the name of the copyright holder nor the names of its
20 * contributors may be used to endorse or promote products derived from
21 * this software without specific prior written permission.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34\**************************************************************************/
35
36#include <Inventor/nodekits/SoSubKit.h>
37#include <Inventor/nodekits/SoBaseKit.h>
38#include <Inventor/fields/SoSFBool.h>
39#include <Inventor/fields/SoSFTime.h>
40#include <Inventor/fields/SoSFString.h>
41#include <Inventor/fields/SoSFColor.h>
42#include <Inventor/fields/SoMFColor.h>
43#include <Inventor/fields/SoMFString.h>
44#include <Inventor/fields/SoSFFloat.h>
45#include <Inventor/fields/SoSFInt32.h>
46#include <Inventor/fields/SoMFString.h>
47#include <Inventor/fields/SoMFFloat.h>
48#include <Inventor/fields/SoMFVec3d.h>
49#include <SmallChange/basic.h>
50
51class SmWellLogKitP;
52class SoSensor;
53class SbString;
54class SmTooltipKit;
55
56class SMALLCHANGE_DLL_API SmWellLogKit : public SoBaseKit {
57 typedef SoBaseKit inherited;
58
59 SO_KIT_HEADER(SmWellLogKit);
60
61 SO_KIT_CATALOG_ENTRY_HEADER(topSeparator);
62 SO_KIT_CATALOG_ENTRY_HEADER(tooltip);
63 SO_KIT_CATALOG_ENTRY_HEADER(utm);
64 SO_KIT_CATALOG_ENTRY_HEADER(transform);
65 SO_KIT_CATALOG_ENTRY_HEADER(topLod);
66 SO_KIT_CATALOG_ENTRY_HEADER(topLodGroup);
67 SO_KIT_CATALOG_ENTRY_HEADER(shapeHints);
68 SO_KIT_CATALOG_ENTRY_HEADER(wellBaseColor);
69 SO_KIT_CATALOG_ENTRY_HEADER(wellDrawStyle);
70 SO_KIT_CATALOG_ENTRY_HEADER(well);
71 SO_KIT_CATALOG_ENTRY_HEADER(wellNameSep);
72 SO_KIT_CATALOG_ENTRY_HEADER(wellNameColor);
73 SO_KIT_CATALOG_ENTRY_HEADER(wellName);
74 SO_KIT_CATALOG_ENTRY_HEADER(lightModel);
75 SO_KIT_CATALOG_ENTRY_HEADER(lod);
76 SO_KIT_CATALOG_ENTRY_HEADER(lodSeparator);
77 SO_KIT_CATALOG_ENTRY_HEADER(callbackNode);
78 SO_KIT_CATALOG_ENTRY_HEADER(coord);
79 SO_KIT_CATALOG_ENTRY_HEADER(materialBinding);
80 SO_KIT_CATALOG_ENTRY_HEADER(faceSetColor);
81 SO_KIT_CATALOG_ENTRY_HEADER(pickStyle);
82 SO_KIT_CATALOG_ENTRY_HEADER(drawStyleSwitch);
83 SO_KIT_CATALOG_ENTRY_HEADER(lineSet);
84 SO_KIT_CATALOG_ENTRY_HEADER(faceSet);
85 SO_KIT_CATALOG_ENTRY_HEADER(info);
86 SO_KIT_CATALOG_ENTRY_HEADER(topsSep);
87 SO_KIT_CATALOG_ENTRY_HEADER(topsFontStyle);
88 SO_KIT_CATALOG_ENTRY_HEADER(topsBaseColor);
89 SO_KIT_CATALOG_ENTRY_HEADER(topsList);
90 SO_KIT_CATALOG_ENTRY_HEADER(topInfo);
91
92public:
93 SmWellLogKit(void);
94 static void initClass(void);
95
96 SoSFFloat undefVal;
97 SoSFString name;
98 SoMFVec3d wellCoord;
99
100 SoMFString curveNames;
102 SoMFString curveUnits;
103 SoMFFloat curveData;
104 SoSFFloat leftSize;
105 SoSFFloat rightSize;
106
107 SoSFInt32 leftCurveIndex;
108 SoSFInt32 rightCurveIndex;
109
110 SoSFColor leftColor;
111 SoSFColor rightColor;
112
113 SoSFBool leftUseLog;
114 SoSFBool rightUseLog;
115
116 SoSFFloat lodDistance1;
117 SoSFFloat lodDistance2;
118 SoSFFloat wellRadius;
119 SoMFColor wellColor;
120
121 SoMFFloat topsDepths;
122 SoMFString topsNames;
123 SoSFColor topsColor;
124 SoSFFloat topsSize;
125
126 SoSFFloat leftCurveMin;
127 SoSFFloat leftCurveMax;
128
129 SoSFFloat rightCurveMin;
130 SoSFFloat rightCurveMax;
131
132 virtual void GLRender(SoGLRenderAction * action);
133 virtual void getBoundingBox(SoGetBoundingBoxAction * action);
134 virtual void handleEvent(SoHandleEventAction * action);
135
136 virtual void callback(SoCallbackAction * action);
137 virtual void getMatrix(SoGetMatrixAction * action);
138 virtual void rayPick(SoRayPickAction * action);
139 virtual void search(SoSearchAction * action);
140 virtual void getPrimitiveCount(SoGetPrimitiveCountAction * action);
141
142 void addTooltipInfo(const char * name,
143 const int curveidx,
144 const int numvalues,
145 const float * data,
146 const char ** datatext);
147
148protected:
149 virtual SbBool readInstance(SoInput * in, unsigned short flags);
150 virtual void notify(SoNotList * l);
151 virtual ~SmWellLogKit();
152 virtual void setDefaultOnNonWritingFields(void);
153
154public:
155
156private:
157
158 int findPickIdx(const SbVec3f & p) const;
159 SbBool setTooltipInfo(const int idx, SmTooltipKit * tooltip);
160 void connectNodes(void);
161 int getNumCurves(void) const;
162 int getNumCurveValues(void) const;
163 float getDepth(const int idx) const;
164 float getLeftCurveData(const int idx) const;
165 float getRightCurveData(const int idx) const;
166
167 friend class SmWellLogKitP;
168 SmWellLogKitP * pimpl;
169};
170
171#endif // SMALLCHANGE_SMWELLLOGKIT_H
Definition misc/SbList.h:69
The SmTooltipKit class...
Definition SmTooltipKit.h:51
Definition SmWellLogKit.h:56
SoMFString curveDescription
Definition SmWellLogKit.h:101
SoMFString curveNames
Definition SmWellLogKit.h:100
SoMFVec3d wellCoord
Definition SmWellLogKit.h:98
SoMFString curveUnits
Definition SmWellLogKit.h:102
SoSFFloat undefVal
Definition SmWellLogKit.h:96
SoSFString name
Definition SmWellLogKit.h:97