Class PoBase

  • 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 node PoDomain).

    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).

    • 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.
      • 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 are SoAsciiText 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 simulate SoLightModel.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.

      • touchKit

        public void touchKit()
        Indicates the node kit is modified. (Simulates a change).
      • getDomain

        public PbDomain getDomain()
        Gets a reference to a PbDomain 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 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).
      • 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 is UPDATE_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)
        Sets a reference to a PbDomain object used to define the data limits of the graphics to be generated. If this method is not called (or called passing NULL as argument), this is the domain defined in the current inherited state (defined with the node PoDomain) which is used.
      • getUpdateMethod

        public PoBase.UpdateMethodTypes getUpdateMethod()
        Gets update method. See setUpdateMethod for more details.