|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.grogra.rgg.Scanner
public class Scanner
Instances of Scanner
enables to scan a structure
using rays. This code is largely inspired from
AvoidIntersection
.
Field Summary | |
---|---|
static int |
HIT
|
static int |
NO_HIT
|
Constructor Summary | |
---|---|
Scanner()
Create an instance of Scanner |
|
Scanner(Vector3d x,
Vector3d y,
Vector3d z,
double thetaRangeParam,
double phiRangeParam,
double thetaStepParam,
double phiStepParam,
double rayLenghtParam)
Create an instance of Scanner |
Method Summary | |
---|---|
void |
beginGroup(java.lang.Object object,
boolean asNode)
This method is invoked by a SceneVisitor when subsequent
volumes shall be grouped into a single compound object. |
void |
endGroup()
This method is invoked by a SceneVisitor when the current group
ends. |
java.lang.Object |
get(java.lang.String key,
java.lang.Object defaultValue)
return options for scene construction and/or concrete light model |
java.util.ArrayList<Point3d> |
getScannedPoints()
Return an ArrayList |
int |
getScannedPointsNb()
returns the number of scanned points (ie length of scannedPoints) |
void |
prepareScene()
This method prepare the whole scene, may for a new intersection-computation. |
void |
scan(Point3d originPoint)
This method triggers the scanning process. |
java.util.ArrayList<Point3d> |
scanCircle(Point3d center,
double radius,
Vector3d normal,
double angleStep)
Does the same as scanCircle(Point3d, double, Vector3d, Vector3d, double) but the origin of the angle (zeroAngleVector) is arbitrary chosen. |
java.util.ArrayList<Point3d> |
scanCircle(Point3d center,
double radius,
Vector3d normalParam,
Vector3d zeroAngleVectorParam,
double angleStep)
Moves the origin of the scanner along the circle of center center, radius radius, and contained in a plane orthogonal to the vector normal ; zeroAngleVector specifies must be orthogonal to normal, and specifies an origin for the angles ; for each angular step angleStep, rays are shot according to the angular parameters specified (see setRange / setSteps) and the local basis (-uR,-uTheta,normal) [see cylindrical coordinate system] |
java.util.ArrayList<Point3d> |
scanCylinder(Point3d startingPoint,
Vector3d axisParam,
double radius,
double angularStep,
double lengthAxisStep,
int nbSteps)
Works as scanCylinder (Point3d, Vector3d, double, double, double, int, Vector3d) but an origin for the angles is arbitrary chosen) |
java.util.ArrayList<Point3d> |
scanCylinder(Point3d startingPoint,
Vector3d axisParam,
double radius,
double angularStep,
double lengthAxisStep,
int nbSteps,
Vector3d zeroAngleVectorParam)
Moves the origin of the scanner on the cylinder which axis starts at startingPoint, has axisParam as direction, and of length (nbSteps-1)* lengthAxisStep, and of radius radius ; for each step along the axis, the origin of the scanner revolves around the axis with an angular step angularStep ; zeroAngleVector specifies must be orthogonal to axisParam, and specifies an origin for the angles ; rays are shot at each step according to the angular parameters specified (see setRange / setSteps) and the local basis (-uR,-uTheta,normal) [see cylindrical coordinate system] |
java.util.ArrayList<Point3d> |
scanSegment(Point3d startingPoint,
Vector3d directionParam,
float stepLength,
int nbSteps)
Move the origin of the scanner along the segment starting at startingPoint, of direction directionParam and of length (nbSteps-1) * stepLength ; rays are shot according to the angular parameters specified (see setRange / setSteps) and the basis set (see setBasis) |
java.util.ArrayList<Point3d> |
scanSphere(Point3d center,
double radius,
double phiStep,
double thetaStep,
Vector3d xParam,
Vector3d yParam,
Vector3d zParam)
Moves the origin of the scanner on a sphere, with a step "phiStep" along the colatitude and a step thetaStep along the longitude. |
void |
setBasis(Vector3d xParam,
Vector3d yParam,
Vector3d zParam)
set the (x,y,z) basis which will serve as reference for the spherical coordinates system ; (x,y,z) must form an orthogonal basis ; the vectors are then normalized to form an orthonormal basis also compute the P matrix, and change the basisCorrect value accordingly |
void |
setDistanceNoise(boolean param)
sets distanceNoise on / off |
void |
setDistanceNoiseType(int type,
boolean adapt,
double param1,
double param2)
sets the parameters for the distance noise |
void |
setLayerVisible(int id,
boolean visible)
Set layer # id to visible (true) or invisible (false). |
void |
setpDrawRay(double pParam)
Sets the probability of drawing one ray. |
void |
setPhiNoise(boolean param)
set phiNoise on / off |
void |
setPhiNoiseType(int type,
boolean adapt,
double param1,
double param2)
sets the parameters for the phi noise |
void |
setPrepareScene()
This method sets the prepareScene flag. |
void |
setRange(double thetaRangeParam,
double phiRangeParam)
Set the angular parameters of the solid angle that will be scanned. |
void |
setRayLength(double rayLengthParam)
Set the length of the rays that will be shot. |
void |
setSteps(double thetaStepParam,
double phiStepParam)
Set the steps for scanning the solid angle. |
void |
setThetaNoise(boolean param)
sets thetaNoise on / off |
void |
setThetaNoiseType(int type,
boolean adapt,
double param1,
double param2)
sets the parameters for the theta noise |
void |
volumeCreated(java.lang.Object object,
boolean asNode,
Volume volume)
This method is invoked by a SceneVisitor when a
volume is created as representation of the geometry
of object . |
void |
writeDataToFile(java.util.ArrayList<Point3d> data,
java.lang.String fileName)
Writes an ArrayList |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int HIT
public static final int NO_HIT
Constructor Detail |
---|
public Scanner()
Scanner
public Scanner(Vector3d x, Vector3d y, Vector3d z, double thetaRangeParam, double phiRangeParam, double thetaStepParam, double phiStepParam, double rayLenghtParam)
Scanner
RayCount
- Number of rays.Method Detail |
---|
public void beginGroup(java.lang.Object object, boolean asNode)
VolumeListener
SceneVisitor
when subsequent
volumes shall be grouped into a single compound object. The group
extends until the corresponding invocation of VolumeListener.endGroup()
.
These invocations may be nested, i.e., there may be groups within
groups.
Each group starts at object
in the graph. If
object
has a geometric representation itself, the
corresponding invocation of VolumeListener.volumeCreated(java.lang.Object, boolean, de.grogra.vecmath.geom.Volume)
may be either
immediately before of after beginGroup
.
beginGroup
in interface VolumeListener
object
- the object of the graph which represents the root
of the groupasNode
- is object
a node or an edge?VolumeListener.endGroup()
public void endGroup()
VolumeListener
SceneVisitor
when the current group
ends.
endGroup
in interface VolumeListener
VolumeListener.beginGroup(java.lang.Object, boolean)
public java.lang.Object get(java.lang.String key, java.lang.Object defaultValue)
get
in interface Options
key
- identifier for optiondefaultValue
- default value of option
key
public java.util.ArrayList<Point3d> getScannedPoints()
public int getScannedPointsNb()
public void prepareScene()
look(Null node, double size, double distance)
invoke this automatically.
public void scan(Point3d originPoint)
originPoint
- Scan from this pointshowLines
- To visualize what is going on in front of node
, set this
parameter true.public java.util.ArrayList<Point3d> scanCircle(Point3d center, double radius, Vector3d normal, double angleStep)
center
- radius
- normal
- angleStep
-
public java.util.ArrayList<Point3d> scanCircle(Point3d center, double radius, Vector3d normalParam, Vector3d zeroAngleVectorParam, double angleStep)
center
- radius
- normalParam
- zeroAngleVectorParam
- angleStep
-
public java.util.ArrayList<Point3d> scanCylinder(Point3d startingPoint, Vector3d axisParam, double radius, double angularStep, double lengthAxisStep, int nbSteps)
startingPoint
- axisParam
- radius
- angularStep
- lengthAxisStep
- nbSteps
-
public java.util.ArrayList<Point3d> scanCylinder(Point3d startingPoint, Vector3d axisParam, double radius, double angularStep, double lengthAxisStep, int nbSteps, Vector3d zeroAngleVectorParam)
startingPoint
- axisParam
- radius
- angularStep
- lengthAxisStep
- nbSteps
- zeroAngleVectorParam
-
public java.util.ArrayList<Point3d> scanSegment(Point3d startingPoint, Vector3d directionParam, float stepLength, int nbSteps)
startingPoint
- directionParam
- stepLength
- nbSteps
-
public java.util.ArrayList<Point3d> scanSphere(Point3d center, double radius, double phiStep, double thetaStep, Vector3d xParam, Vector3d yParam, Vector3d zParam)
center
- radius
- phiStep
- thetaStep
- xParam
- yParam
- zParam
-
public void setBasis(Vector3d xParam, Vector3d yParam, Vector3d zParam)
x
- y
- z
- public void setDistanceNoise(boolean param)
param
- public void setDistanceNoiseType(int type, boolean adapt, double param1, double param2)
type
- 0 for uniform noise, 1 for gaussian noiseadapt
- false for a fixed noise, true for a noise dependent on the valueparam1
- param2
- public void setLayerVisible(int id, boolean visible)
id
to visible (true) or invisible (false).
id
- Layer idvisible
- Layer visible or not.public void setpDrawRay(double pParam)
pParam
- public void setPhiNoise(boolean param)
param
- public void setPhiNoiseType(int type, boolean adapt, double param1, double param2)
type
- 0 for uniform noise, 1 for gaussian noiseadapt
- false for a fixed noise, true for a noise dependent on the valueparam1
- param2
- public void setPrepareScene()
prepareScene
flag. When the method
prepareScene()
is invoked, an octree will re-computed.
public void setRange(double thetaRangeParam, double phiRangeParam)
thetaRange
- angular opening in thetaphiRange
- angular opening in phipublic void setRayLength(double rayLengthParam)
rayLengthParam
- public void setSteps(double thetaStepParam, double phiStepParam)
thetaStepParam
- step for the theta parameterphiStepParam
- step for the phi parameterpublic void setThetaNoise(boolean param)
param
- public void setThetaNoiseType(int type, boolean adapt, double param1, double param2)
type
- 0 for uniform noise, 1 for gaussian noiseadapt
- false for a fixed noise, true for a noise dependent on the valueparam1
- param2
- public void volumeCreated(java.lang.Object object, boolean asNode, Volume volume)
VolumeListener
SceneVisitor
when a
volume
is created as representation of the geometry
of object
. By storing the information provided by the
parameters, the link from graph objects (nodes and edges) to volumes
can be established.
volumeCreated
in interface VolumeListener
object
- an object of the graphasNode
- is object
a node or an edge?volume
- the volume which has been created as geometrical
representation of object
public void writeDataToFile(java.util.ArrayList<Point3d> data, java.lang.String fileName) throws java.io.IOException
data
- fileName
-
java.io.IOException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |