Package com.comsol.model
Interface ResultFeature
-
- All Superinterfaces:
ModelEntity
,PrimitiveModelEntity
,PropFeature
,ResultBaseFeature
,SelectionContainer
,SelectionEntity
,ViewBase
,ViewFeature
public interface ResultFeature extends ResultBaseFeature, ViewBase, ViewFeature
Post features represent plots, plot groups and their attributes.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
canStepFirst(int level)
Returns true if it is possible to step to the first parameter value.boolean
canStepLast(int level)
Returns true if it is possible to step to the last parameter value.boolean
canStepNext(int level)
Returns true if it is possible to step to the next parameter value.boolean
canStepPrevious(int level)
Returns true if it is possible to step to the previous parameter value.ResultFeature
create(java.lang.String tag, java.lang.String type)
Create a result feature.ConfigurationFeature
createStyleConfiguration(java.lang.String confTag)
Creates a style configuration from the settings in the plot.TableFeature
createTable(java.lang.String tableTag)
Creates a table containing the data for the plot.void
discardFile()
Discard the file that this plot feature uses.void
exportFile(java.lang.String filename)
Export the file that this plot feature uses.ResultFeatureList
feature()
Gets the list of sub-features for this ResultFeature.ResultFeature
feature(java.lang.String tag)
Get the sub-feature with the given name, or an exception otherwise.java.lang.String[]
getAxisUnits()
Returns the units of the coordinate axes for the plot group to which the feature belongs; null for 1D plot groups.int[][]
getBoundaryElements(int renderIndex, int groupIndex)
Get the elements for the boundary of the current plot, if applicable.double[]
getColor(java.lang.String name, boolean useGraphicsTheme)
Returns the color specified by a property.double[]
getColor(java.lang.String name, java.lang.String colorTheme)
Returns the color specified by a property.float[]
getData(int renderIndex, int groupIndex, java.lang.String dataType)
Get the data vector for a specific data type.float[]
getDataMinMax(int renderIndex, int groupIndex, java.lang.String dataType)
Get the maximum and minimum data for a specific data type.java.lang.String[]
getDataTypes(int renderIndex)
Gets the available data types within the plot.int[][]
getElements(int renderIndex, int groupIndex)
Gets the elements of the plot.int
getGroups(int renderIndex)
Retrieves the number of groups for a rendering type.float[][]
getNormals(int renderIndex, int groupIndex)
Gets the vertex normals.ResultFeature
getPlotGroup()
Resolves the plot group this result feature belongs to.int
getRenderGroups()
Returns the number of rendering types within the plot.int
getSDim()
Get this feature's space dimension.int
getStepCount(int level)
Returns the number of values that it is possible to step through on a level using thestepNext(int)
,stepPrevious(int)
,stepFirst(int)
, andstepLast(int)
methods.int
getStepLevels()
Returns the number of variables that it is possible to step over.int[]
getVertexElements(int renderIndex, int groupIndex)
Gets the element each vertex belongs to.float[][]
getVertices(int renderIndex, int groupIndex)
Gets the vertex coordinates.void
importFile()
Import the file that this plot feature uses.boolean
isPlotGroup()
Returnstrue
if this result feature is a plot group.ViewFeature
prepareView(boolean create)
Returns the view to use when plotting the plot group to which the feature belongs.void
refreshFile()
Refresh the file that this plot feature uses.void
run()
Generate and render data for plot group.LocalSelection
selection(java.lang.String name)
Returns a selection property.boolean
stepFirst(int level)
Step to the first parameter value.boolean
stepLast(int level)
Step to the last parameter value.boolean
stepNext(int level)
Step to the next parameter value.boolean
stepPrevious(int level)
Step to the previous parameter value.-
Methods inherited from interface com.comsol.model.ModelEntity
active, author, author, comments, comments, dateCreated, dateModified, docMarker, docMarker, help, help, icon, isactive, isActive, label, label, lastModifiedBy, model, model, name, name, resetAuthor, scope, tag, tag, timeCreated, timeModified, version, version
-
Methods inherited from interface com.comsol.model.PrimitiveModelEntity
getContainer, getDisplayString, resolveModelPath
-
Methods inherited from interface com.comsol.model.PropFeature
getAllowedPropertyValues, getBoolean, getBoolean, getBoolean, getBooleanArray, getBooleanMatrix, getDouble, getDouble, getDouble, getDoubleArray, getDoubleMatrix, getEntryKeyIndex, getEntryKeys, getInt, getInt, getInt, getIntArray, getIntMatrix, getReferenceArray, getString, getString, getString, getString, getStringArray, getStringMatrix, getType, getValueType, hasProperty, hasSelection, move, move, properties, remove, remove, set, set, set, set, set, set, set, set, set, set, set, set, setEntry, setEntry, setEntry, setEntry, setIndex, setIndex, setIndex, setIndex, setIndex, setIndex, setIndex, setIndex, setIndex, setIndex, setIndex, setIndex
-
Methods inherited from interface com.comsol.model.ResultBaseFeature
hasWarning, problem, problem, refresh, runCommand
-
Methods inherited from interface com.comsol.model.SelectionEntity
selection
-
Methods inherited from interface com.comsol.model.ViewBase
axis, camera, clip, clip, hideEntities, hideEntities, hideMesh, hideMesh, hideObjects, hideObjects, light, light
-
-
-
-
Method Detail
-
canStepFirst
boolean canStepFirst(int level)
Returns true if it is possible to step to the first parameter value.- Parameters:
level
- Parameter level.- Returns:
- True if it possible to step.
-
canStepLast
boolean canStepLast(int level)
Returns true if it is possible to step to the last parameter value.- Parameters:
level
- Parameter level.- Returns:
- True if it possible to step.
-
canStepNext
boolean canStepNext(int level)
Returns true if it is possible to step to the next parameter value.- Parameters:
level
- Parameter level.- Returns:
- True if it possible to step.
-
canStepPrevious
boolean canStepPrevious(int level)
Returns true if it is possible to step to the previous parameter value.- Parameters:
level
- Parameter level.- Returns:
- True if it possible to step.
-
create
ResultFeature create(java.lang.String tag, java.lang.String type)
Create a result feature.- Parameters:
tag
- Feature tag.type
- Type of feature.- Returns:
- Created result feature.
-
createStyleConfiguration
ConfigurationFeature createStyleConfiguration(java.lang.String confTag)
Creates a style configuration from the settings in the plot. Only supported for some plot types.- Parameters:
confTag
- The configuration tag.- Returns:
- The table.
-
createTable
TableFeature createTable(java.lang.String tableTag)
Creates a table containing the data for the plot.- Parameters:
tableTag
- The table tag.- Returns:
- The table.
-
discardFile
void discardFile()
Discard the file that this plot feature uses.
-
exportFile
void exportFile(java.lang.String filename)
Export the file that this plot feature uses.- Parameters:
filename
- Filename.
-
feature
ResultFeatureList feature()
Gets the list of sub-features for this ResultFeature.- Returns:
- List of result features.
-
feature
ResultFeature feature(java.lang.String tag)
Get the sub-feature with the given name, or an exception otherwise.- Parameters:
tag
- Result feature tag.- Returns:
- Result feature.
-
getAxisUnits
java.lang.String[] getAxisUnits()
Returns the units of the coordinate axes for the plot group to which the feature belongs; null for 1D plot groups.- Returns:
- An array of length 2 or 3 containing LaTeX-formatted units, or null if no units are available.
-
getBoundaryElements
int[][] getBoundaryElements(int renderIndex, int groupIndex)
Get the elements for the boundary of the current plot, if applicable.- Parameters:
renderIndex
- Rendering index indicating rendering type within plot.groupIndex
- Group index indicating groups or part within rendering group index.- Returns:
- Matrix of boundary indices.
-
getColor
double[] getColor(java.lang.String name, java.lang.String colorTheme)
Returns the color specified by a property. If the property's string value is "custom", the value of the corresponding "custom"-color property will be returned. If the string value is "fromtheme", the theme color will be returned.- Parameters:
name
- Property name.colorTheme
- If the property is set to take the color from a color theme, use this theme.- Returns:
- The color as an array with the RGB values.
-
getColor
double[] getColor(java.lang.String name, boolean useGraphicsTheme)
Returns the color specified by a property. If the property's string value is "custom", the value of the corresponding "custom"-color property will be returned. If the string value is "fromtheme", the theme color will be returned.- Parameters:
name
- Property name.useGraphicsTheme
- If true, use the model's graphics color theme, If false, use the model's image export color theme.- Returns:
- The color as an array with the RGB values.
-
getData
float[] getData(int renderIndex, int groupIndex, java.lang.String dataType)
Get the data vector for a specific data type.- Parameters:
renderIndex
- Rendering index indicating rendering type within plot.groupIndex
- Group index indicating groups or part within rendering group index.dataType
- Plot data type; use getDataTypes to determine supported plot data types.- Returns:
- Data associated with each vertex of the plot.
-
getDataMinMax
float[] getDataMinMax(int renderIndex, int groupIndex, java.lang.String dataType)
Get the maximum and minimum data for a specific data type.- Parameters:
renderIndex
- Rendering index indicating rendering type within plot.groupIndex
- Group index indicating groups or part within rendering group index.dataType
- Plot data type; use getDataTypes to determine supported plot data types.- Returns:
- Two elements vector with minimum and maximum values.
-
getDataTypes
java.lang.String[] getDataTypes(int renderIndex)
Gets the available data types within the plot.- Parameters:
renderIndex
- Rendering index indicating rendering type within plot.- Returns:
- Available plot data types within the plot, for example,
Color
.
-
getElements
int[][] getElements(int renderIndex, int groupIndex)
Gets the elements of the plot.- Parameters:
renderIndex
- Rendering index indicating rendering type within plot.groupIndex
- Group index indicating groups or part within rendering group index.- Returns:
- Matrix of element indices.
-
getGroups
int getGroups(int renderIndex)
Retrieves the number of groups for a rendering type.- Parameters:
renderIndex
- Rendering type index.- Returns:
- Number of groups.
-
getNormals
float[][] getNormals(int renderIndex, int groupIndex)
Gets the vertex normals.- Parameters:
renderIndex
- Rendering index indicating rendering type within plot.groupIndex
- Group index indicating groups or part within rendering group index.- Returns:
- Matrix of vertex normals with each column corresponding to a single vertex. Empty if no normals are available for the plot.
-
getPlotGroup
ResultFeature getPlotGroup()
Resolves the plot group this result feature belongs to. If the feature is a plot group, returns itself.- Returns:
- The plot group.
-
getRenderGroups
int getRenderGroups()
Returns the number of rendering types within the plot.- Returns:
- Number of rendering types with a plot.
-
getSDim
int getSDim()
Get this feature's space dimension. This is the same as the plot group's dimension.- Returns:
- Space dimension.
-
getStepCount
int getStepCount(int level)
Returns the number of values that it is possible to step through on a level using thestepNext(int)
,stepPrevious(int)
,stepFirst(int)
, andstepLast(int)
methods.- Parameters:
level
- Parameter level.- Returns:
- The number of values.
-
getStepLevels
int getStepLevels()
Returns the number of variables that it is possible to step over.- Returns:
- The number of levels.
-
getVertexElements
int[] getVertexElements(int renderIndex, int groupIndex)
Gets the element each vertex belongs to.- Parameters:
renderIndex
- Rendering index indicating rendering type within plot.groupIndex
- Group index indicating groups or part within rendering group index.- Returns:
- Vector of element index for each vertex.
-
getVertices
float[][] getVertices(int renderIndex, int groupIndex)
Gets the vertex coordinates.- Parameters:
renderIndex
- Rendering index indicating rendering type within plot.groupIndex
- Group index indicating groups or part within rendering group index.- Returns:
- Matrix of vertex coordinates with each column corresponding to a single vertex.
-
importFile
void importFile()
Import the file that this plot feature uses.
-
isPlotGroup
boolean isPlotGroup()
Returnstrue
if this result feature is a plot group.- Returns:
true
if a plot group.
-
prepareView
ViewFeature prepareView(boolean create)
Returns the view to use when plotting the plot group to which the feature belongs.- Parameters:
create
- If true, the view is created if needed.- Returns:
- The view to use; null if none.
-
refreshFile
void refreshFile()
Refresh the file that this plot feature uses.
-
run
void run()
Generate and render data for plot group.
-
selection
LocalSelection selection(java.lang.String name)
Returns a selection property.- Specified by:
selection
in interfacePropFeature
- Parameters:
name
- Selection property name.- Returns:
- Requested selection property.
-
stepFirst
boolean stepFirst(int level)
Step to the first parameter value.- Parameters:
level
- Parameter level.- Returns:
- True if the parameter value was changed.
-
stepLast
boolean stepLast(int level)
Step to the last parameter value.- Parameters:
level
- Parameter level.- Returns:
- True if the parameter value was changed.
-
stepNext
boolean stepNext(int level)
Step to the next parameter value.- Parameters:
level
- Parameter level.- Returns:
- True if the parameter value was changed.
-
stepPrevious
boolean stepPrevious(int level)
Step to the previous parameter value.- Parameters:
level
- Parameter level.- Returns:
- True if the parameter value was changed.
-
-