Package com.openinventor.meshviz.graph
Class PoBase
- java.lang.Object
-
- All Implemented Interfaces:
SafeDisposable
- Direct Known Subclasses:
Po3DdataMaster
,PoGraphMaster
public class PoBase extends SoBaseKit
Abstract base class for all Graph Master & 3D Data Master classes. All representations depend on the current domain which defines the data limits of the graphic to be generated. If the method setDomain(domain) is called, the current domain is "domain". Otherwise the current domain is specified in the current inherited state (cf property nodePoDomain
).Be careful, do not use the method
rebuild()
if you use MeshViz property nodes (PoDomain
,PoMeshProperty
,...), because a representation (axis, legend, 2D and 3D mesh representation,..) depends on the current inherited state. If you need to do an extra work after a representation has been built, do it in a post-rebuild callback (cf PoBase.addPostRebuildCallback).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PoBase.NodeWriteFormats
Type of write format.static class
PoBase.TextTypes
Type of Text.static class
PoBase.UpdateMethodTypes
Type of update method.-
Nested classes/interfaces inherited from class com.openinventor.inventor.nodes.SoNode
SoNode.RenderModes
-
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand
-
-
Field Summary
-
Fields inherited from class com.openinventor.inventor.nodekits.SoBaseKit
boundingBoxIgnoring
-
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPostRebuildCallback(PoRebuildCB cb, java.lang.Object data)
Add a callback function to call when the node kit is rebuilt.void
addPreRebuildCallback(PoRebuildCB cb, java.lang.Object data)
Add a callback function to call when the node kit is rebuilt.static SoNodekitCatalog
getClassNodekitCatalog()
Returns theSoNodekitCatalog
for this class.PbDomain
getDomain()
Gets a reference to aPbDomain
object used to define the data limits of the graphics to be generated.static PoBase.NodeWriteFormats
getNodeWriteFormat()
Gets the node write format.static PoBase.TextTypes
getTextType()
Gets the type of text used.PoBase.UpdateMethodTypes
getUpdateMethod()
Gets update method.boolean
isBuilt()
Indicates if the node kit has been built at least once.boolean
isModified()
Return true, if the kit has been modified, else otherwise.static boolean
isVRML2Mode()
Gets the VRML2 mode (true = VRML2 mode, false Inventor mode)void
rebuild()
Forces the node kit to be rebuilt immediately.void
setDomain(PbDomain dom)
Sets a reference to aPbDomain
object used to define the data limits of the graphics to be generated.static void
setNodeWriteFormat(PoBase.NodeWriteFormats format)
Sets the node write format.static void
setTextType(PoBase.TextTypes type)
Sets the type of text used.void
setUpdateMethod(PoBase.UpdateMethodTypes type)
Sets scene graph update method.static void
setVRML2Mode(boolean flag)
Set the VRML2 mode.void
touchKit()
Indicates the node kit is modified.-
Methods inherited from class com.openinventor.inventor.nodekits.SoBaseKit
getNodekitCatalog, getPart, getPart, getPartString, getViewportIsEnabled, getViewportOrigin, getViewportSize, isSearchingChildren, set, set, setPart, setSearchingChildren
-
Methods inherited from class com.openinventor.inventor.nodes.SoNode
affectsState, callback, copy, copy, distribute, doAction, getAlternateRep, getBoundingBox, getByName, getMatrix, getPrimitiveCount, getRenderEngineMode, getRenderUnitID, GLRender, GLRenderBelowPath, GLRenderInPath, GLRenderOffPath, grabEventsCleanup, grabEventsSetup, handleEvent, isBoundingBoxIgnoring, isOverride, pick, rayPick, search, setOverride, touch, write
-
Methods inherited from class com.openinventor.inventor.fields.SoFieldContainer
copyFieldValues, copyFieldValues, enableNotify, fieldsAreEqual, get, getAllFields, getEventIn, getEventOut, getField, getFieldName, hasDefaultValues, isNotifyEnabled, setToDefaults
-
Methods inherited from class com.openinventor.inventor.misc.SoBase
dispose, getName, isDisposable, isSynchronizable, setName, setSynchronizable
-
Methods inherited from class com.openinventor.inventor.Inventor
getNativeResourceHandle
-
-
-
-
Method Detail
-
addPreRebuildCallback
public void addPreRebuildCallback(PoRebuildCB cb, java.lang.Object data)
Add a callback function to call when the node kit is rebuilt. This callback is called just before the kit is rebuilt.
-
addPostRebuildCallback
public void addPostRebuildCallback(PoRebuildCB cb, java.lang.Object data)
Add a callback function to call when the node kit is rebuilt. This callback is called just after the kit is rebuilt.
-
isBuilt
public boolean isBuilt()
Indicates if the node kit has been built at least once.
-
getTextType
public static PoBase.TextTypes getTextType()
Gets the type of text used.
-
setNodeWriteFormat
public static void setNodeWriteFormat(PoBase.NodeWriteFormats format)
Sets the node write format.FOLD_NODE_WRITE_FORMAT
indicates that all nodes will not be unfolded when they are written with aSoWriteAction
.UNFOLD_NODE_WRITE_FORMAT
indicates on the contrary, that all nodes will be unfolded when they are written with aSoWriteAction
. Be careful, when using the formatFOLD_NODE_WRITE_FORMAT
, the basic objects (Pb objects) are not written in .iv file. In this case (and if you need to save this information), use the corresponding property node (for instance, replace thePbDomain
object with thePoDomain
property node).(
FOLD_NODE_WRITE_FORMAT
by default).
-
getClassNodekitCatalog
public static SoNodekitCatalog getClassNodekitCatalog()
Returns theSoNodekitCatalog
for this class.
-
setTextType
public static void setTextType(PoBase.TextTypes type)
Sets the type of text used. Possible values :- type =
SO_TEXT3
: All texts used for representations areSoText3
nodes. - type =
SO_ANNO_TEXT3
: All text used for representations areSoAnnoText3
(this type of text has more attributes thanSoText3
which can be specified with the property nodeSoAnnoText3Property
).
type =
SO_ANNO_TEXT3
by default. - type =
-
getNodeWriteFormat
public static PoBase.NodeWriteFormats getNodeWriteFormat()
Gets the node write format. See setNodeWriteFormat for more details.
-
setVRML2Mode
public static void setVRML2Mode(boolean flag)
Set the VRML2 mode. This mode allows the user to configure MeshViz to prepare the conversion in VRML2 format with the best possible result. In this way, MeshViz realizes some particular actions :- Whatever text type specified by the method
setTextType()
, all texts used areSoAsciiText
in order to minimize VRML2 file size (other text types are tessellated during a VRML2 conversion which increases VRML2 file size). - For all materials generated by MeshViz where the light model is
SoLightModel.BASE_COLOR
(There is no equivalence in VRML2), the emissive component is set at the same value as the diffuse components (By this way, we simulateSoLightModel.BASE_COLOR
light model). - A Z Offset is added for all coplanar faces generated by MeshViz representation (All these representations are planar as for instance legends so the
SoAnnotation
node solves their problems, but there is no equivalence in VRML2).
This mode is inactive by default.
- Whatever text type specified by the method
-
touchKit
public void touchKit()
Indicates the node kit is modified. (Simulates a change).
-
getDomain
public PbDomain getDomain()
Gets a reference to aPbDomain
object used to define the data limits of the graphics to be generated.
-
rebuild
public void rebuild()
Forces the node kit to be rebuilt immediately. The rebuild consists in updating all catalog parts (which contains shapes forming the visualization) of the node kit according to field values and other property values (domain, data mapping,...). Be careful, do not use the methodrebuild()
if you use MeshViz property nodes (PoDomain
,PoMeshProperty
,...), because a representation (axis, legend, 2D and 3D mesh representation,..) depends on the current inherited state. If you need to do an extra work after a representation has been built, do it in a post-rebuild callback (cf PoBase.addPostRebuildCallback).
-
isModified
public boolean isModified()
Return true, if the kit has been modified, else otherwise.
-
setUpdateMethod
public void setUpdateMethod(PoBase.UpdateMethodTypes type)
Sets scene graph update method.UPDATE_METHOD_IMMEDIATE
indicates that each time a Graph Master or 3D Data Master object is modified, the scene graph must be updated.UPDATE_METHOD_ON_ACTION
indicates that the scene graph does not have to be modified when a Graph Master or 3D Data Master object changes; the scene graph being modified when it is necessary (before a rendering action for instance). The faster method isUPDATE_METHOD_ON_ACTION
and is particularly useful for representations where more than one field has to be set to obtain the definitive representation, because with the other method, each time a field is changed, the representation is rebuilt. (UPDATE_METHOD_ON_ACTION
by default).
-
isVRML2Mode
public static boolean isVRML2Mode()
Gets the VRML2 mode (true = VRML2 mode, false Inventor mode)
-
setDomain
public void setDomain(PbDomain dom)
-
getUpdateMethod
public PoBase.UpdateMethodTypes getUpdateMethod()
Gets update method. See setUpdateMethod for more details.
-
-