Package com.irurueta.geometry.io
Class ElementPLY
java.lang.Object
com.irurueta.geometry.io.ElementPLY
Contains an element of the header in a PLY file.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StringName of the element (i.e.private final longNumber of instances of this element (i.e. number of vertices or faces).private final List<PropertyPLY>List of properties forming this element. -
Constructor Summary
ConstructorsConstructorDescriptionElementPLY(String name, long nInstances) Constructor.ElementPLY(String name, long nInstances, PropertyPLY property) Constructor.ElementPLY(String name, long nInstances, List<PropertyPLY> properties) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates whether properties have already been set and are available for retrieval.getName()Returns name of this element.longReturns number of instances of this element (i.e. number of vertices or number of faces).Returns list of properties contained in this element.booleanDetermines whether a name for this element has been provided or not.booleanIndicates if this element is valid (i.e. it has a name)toString()Converts this element to string representation ready to be written in the header of a PLY file.
-
Field Details
-
name
Name of the element (i.e. 'vertex' or 'face'). -
nInstances
private final long nInstancesNumber of instances of this element (i.e. number of vertices or faces). -
properties
List of properties forming this element. For a property it could be x, y, z properties for vertex coordinates, nx, ny, nz for vertex normals or red, green, blue, alpha for vertex color.
-
-
Constructor Details
-
ElementPLY
Constructor.- Parameters:
name- Name of this element (i.e. 'vertex' or 'face').nInstances- Number of instances of this element (i.e. number of vertices or faces).
-
ElementPLY
Constructor.- Parameters:
name- Name of this element (i.e. 'vertex' or 'face').nInstances- Number of instances of this element (i.e. number of vertices or faces).property- Property to be set on this element.
-
ElementPLY
Constructor.- Parameters:
name- Name of this element (i.e. 'vertex' or 'face').nInstances- Number of instances of this element (i.e. number of vertices or faces).properties- List of properties to be assigned to this element.
-
-
Method Details
-
getName
Returns name of this element.- Returns:
- name of this element.
- Throws:
NotAvailableException- Raised if name is not available.
-
isNameAvailable
public boolean isNameAvailable()Determines whether a name for this element has been provided or not.- Returns:
- True if element is set (different of null), false otherwise.
-
getNumberOfInstances
public long getNumberOfInstances()Returns number of instances of this element (i.e. number of vertices or number of faces).- Returns:
- Number of instances of this element in the file.
-
getProperties
Returns list of properties contained in this element.- Returns:
- List of properties contained in this element.
- Throws:
NotAvailableException- Raised if no properties have already been set.
-
arePropertiesAvailable
public boolean arePropertiesAvailable()Indicates whether properties have already been set and are available for retrieval.- Returns:
- True if properties are available, false otherwise.
-
isValidElement
public boolean isValidElement()Indicates if this element is valid (i.e. it has a name)- Returns:
- True if element is valid, false otherwise.
-
toString
Converts this element to string representation ready to be written in the header of a PLY file.
-