/** * Fills the given buffer with vertex data from the given object. * * @param the id of the given object. * @param the buffer to fill. * @param the number of coordinates taken by one element in the buffer. * @param the bit mask specifying which coordinates are filled (1 for X, 2 for Y, 4 for Z). * @param the conversion scale factor to apply to data. * @param the conversion translation value to apply to data. * @param the bit mask specifying whether logarithmic coordinates are used. */ public static void fillVertices( Integer id, FloatBuffer buffer, int elementsSize, int coordinateMask, double[] scale, double[] translation, int logMask) { int type = (Integer) GraphicController.getController().getProperty(id, GraphicObjectProperties.__GO_TYPE__); switch (type) { case GraphicObjectProperties.__GO_ARC__: ArcDecomposer.fillVertices( buffer, id, elementsSize, coordinateMask, scale, translation, logMask); break; case GraphicObjectProperties.__GO_CHAMP__: ChampDecomposer.fillVertices( buffer, id, elementsSize, coordinateMask, scale, translation, logMask); break; case GraphicObjectProperties.__GO_RECTANGLE__: RectangleDecomposer.fillVertices( buffer, id, elementsSize, coordinateMask, scale, translation, logMask); break; case GraphicObjectProperties.__GO_SEGS__: SegsDecomposer.fillVertices( buffer, id, elementsSize, coordinateMask, scale, translation, logMask); break; } }
/** * Returns the number of data elements for the given object. * * @param the id of the given object. * @return the number of data elements. */ public static int getDataSize(Integer id) { int type = (Integer) GraphicController.getController().getProperty(id, GraphicObjectProperties.__GO_TYPE__); switch (type) { case GraphicObjectProperties.__GO_ARC__: return ArcDecomposer.getDataSize(); case GraphicObjectProperties.__GO_CHAMP__: return ChampDecomposer.getDataSize(id); case GraphicObjectProperties.__GO_RECTANGLE__: return RectangleDecomposer.getDataSize(); case GraphicObjectProperties.__GO_SEGS__: return SegsDecomposer.getDataSize(id); default: return 0; } }
/** * Fills the given buffer with wireframe index data of the given object. * * @param the id of the given object. * @param the buffer to fill. * @param the bit mask specifying whether logarithmic coordinates are used. * @return the number of indices actually written. */ public static int fillWireIndices(Integer id, IntBuffer buffer, int logMask) { int type = (Integer) GraphicController.getController().getProperty(id, GraphicObjectProperties.__GO_TYPE__); switch (type) { case GraphicObjectProperties.__GO_ARC__: return ArcDecomposer.fillWireIndices(buffer, id, logMask); case GraphicObjectProperties.__GO_CHAMP__: return ChampDecomposer.fillWireIndices(buffer, id, logMask); case GraphicObjectProperties.__GO_RECTANGLE__: return RectangleDecomposer.fillWireIndices(buffer, id, logMask); case GraphicObjectProperties.__GO_SEGS__: return SegsDecomposer.fillWireIndices(buffer, id, logMask); default: return 0; } }