Archon::X3D::Viewer Struct Reference

Collaboration diagram for Archon::X3D::Viewer:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Viewer (Ref< Server >, int resolutionX, int resolutionY, bool useMipmapedTextures, string initialViewpointName, const CoordSystem3x3 &defaultViewpoint, double fieldOfView, double depthOfRotation, const Vector4 &backgroundColor, int subdivisionX, int subdivisionY, bool headLight, bool showLightSources, bool showNormals, bool textAsQuadsMode, bool wireframeMode, bool enableTexture)
bool bindViewpoint (string name)
 Attempt to bind the viewpoint with the specified name.
void resetViewpoint (string initialViewpointName, const CoordSystem3x3 &defaultViewpoint)
void setPointingDeviceActive (bool m)
 For conventional 2-D mice pass true whenever the primary mouse button is pressed and false whenever it is released.
void setInitialPointingDevicePosition2D (Vector2)
 Call this method right after construction of this object if you are using a convetional 2-D mouse.
void setPointingDevicePosition2D (Vector2)
 Use this method for convetional 2-D mouse.
void renderFrame ()
 Application selection:.
bool getOverStatus () const
bool getDragStatus () const
bool getHeadLight () const
void setHeadLight (bool m=true)
bool getShowLightSources () const
void setShowLightSources (bool m=true)
bool getDisregardSensors () const
void setDisregardSensors (bool m=true)
bool getEnableTexture () const
void setEnableTexture (bool m=true)
bool getWireframeMode () const
void setWireframeMode (bool m=true)
bool getShowNormals () const
void setShowNormals (bool m=true)
bool getTextAsQuadsMode () const
void setTextAsQuadsMode (bool m=true)
bool getSeparateSpecularColorMode () const
void setSeparateSpecularColorMode (bool m=true)
bool getLightModelLocalViewerMode () const
void setLightModelLocalViewerMode (bool m=true)
CoordSystem3x3manipViewCoordSystem ()
double getDepthOfRotation () const
void setDepthOfRotation (double d)

Classes

struct  Hit
struct  ShapeCache

Detailed Description

Definition at line 36 of file view.H.


Member Function Documentation

bool Archon::X3D::Viewer::bindViewpoint string  name  ) 
 

Attempt to bind the viewpoint with the specified name.

Returns:
True if a viewpoint exists with that name.

Definition at line 114 of file view.C.

References Archon::Utilities::Ref< T >::get(), and n.

Referenced by resetViewpoint(), and Viewer().

bool Archon::X3D::Viewer::getDragStatus  )  const [inline]
 

Returns:
True if the pointing device was used in a drag operation at the time the last frame was rendered.

Definition at line 104 of file view.H.

Referenced by Archon::Console3d::viewScene().

bool Archon::X3D::Viewer::getOverStatus  )  const [inline]
 

Returns:
True if the pointing device was indicating geometry infuenced by at least one sensor at the time the last frame was rendered.

Definition at line 98 of file view.H.

Referenced by Archon::Console3d::viewScene().

void Archon::X3D::Viewer::renderFrame  ) 
 

Application selection:.

Applications may be selected for manipulation by clicking on any part of its geometry while holding down a certain modifier key. An obvious solution could be to add a TouchSensor to the root group of every application, then to enable all such TouchSensors when entering the modified selection mode. The problem here is that the applications themselves may have other PointingDeviceSensorNodes that will "steal" the clicks. Due to this fact, we need to hardcode the modified selection mode, but we will still utilize the logical equivalence with the standard TouchSensors.

Todo:
Considder if we should apply texture transformations to the hit texture coordinates before sending them to the touch sensors.
X3D spec seems to not specify if this must be done. CosmoPlayer does not do it.

The pointing ray (mouse ray) must originate on the viewplane (near clipping plane) to prevent collision with geometry that is so close to the eye that it cannot be seen (is clipped away).

This in turn means that the origin and the direction of the pointing ray are always identical vectors. Because this fact can be used to cut down work load we represent the pointing ray only by the single vector that defines both the starting point and the direction of the ray.

Definition at line 1318 of file view.C.

References Archon::Math::angle(), Archon::Math::Rotation3::angle, Archon::Math::CoordSystem3x3::basis, Archon::X3D::GroupingNode::begin(), Archon::X3D::EventSource::cascadeEvent(), Archon::X3D::Viewer::ShapeCache::cleanUp(), Archon::Math::Ray3::direction, Archon::X3D::CylinderSensor::diskAngle, Archon::Math::dot(), Archon::X3D::GroupingNode::end(), Archon::Utilities::Ref< T >::get(), Archon::X3D::Transform::getCenter(), Archon::X3D::SensorNode::getEnabled(), Archon::X3D::SceneBase::getRootGroupNoLock(), Archon::Math::Quaternion::getRotation(), Archon::X3D::Transform::getRotation(), Archon::X3D::Transform::getScale(), Archon::X3D::Transform::getScaleOrientation(), Archon::X3D::Transform::getTranslation(), Archon::X3D::TouchSensor::hitNormal, Archon::X3D::TouchSensor::hitNormalChanged, Archon::X3D::TouchSensor::hitPoint, Archon::X3D::TouchSensor::hitPointChanged, Archon::X3D::TouchSensor::hitTexCoord, Archon::X3D::TouchSensor::hitTexCoordChanged, Archon::Math::CoordSystem3x3::identity(), Archon::Math::intersect(), Archon::Math::intersectCylinder(), Archon::Math::Matrix3x3::invScale(), Archon::X3D::SensorNode::isActive, Archon::X3D::SensorNode::isActiveChanged, Archon::X3D::PointingDeviceSensorNode::isOver, Archon::X3D::PointingDeviceSensorNode::isOverChanged, Archon::Math::length(), Archon::Math::BasicVector< T, N >::length(), Archon::Math::Matrix3x3::map(), Archon::Math::CoordSystem3x3::map(), Archon::X3D::CylinderSensor::maxAngle, Archon::X3D::PlaneSensor::maxPosition, Archon::X3D::CylinderSensor::minAngle, Archon::X3D::PlaneSensor::minPosition, Archon::Math::BasicVector< T, N >::negate(), Archon::Math::BasicVector< T, N >::normalize(), Archon::X3D::CylinderSensor::offset, Archon::X3D::SphereSensor::offset, Archon::X3D::PlaneSensor::offset, Archon::X3D::CylinderSensor::offsetChanged, Archon::X3D::SphereSensor::offsetChanged, Archon::X3D::PlaneSensor::offsetChanged, Archon::Math::CoordSystem3x3::origin, Archon::Math::Ray3::origin, Archon::Math::Sphere3::radius, Archon::rootGroup, Archon::Math::Matrix3x3::rotate(), Archon::X3D::CylinderSensor::rotation, Archon::X3D::SphereSensor::rotation, Archon::X3D::CylinderSensor::rotationChanged, Archon::X3D::SphereSensor::rotationChanged, Archon::Math::Matrix3x3::scale(), Archon::Math::Matrix3x3::setInverseOf(), Archon::Math::Quaternion::setRotation(), Archon::Math::BasicVector< T, N >::squareSum(), Archon::X3D::TouchSensorNode::touchTime, Archon::X3D::TouchSensorNode::touchTimeChanged, Archon::Math::CoordSystem3x3::translate(), Archon::X3D::PlaneSensor::translation, Archon::X3D::PlaneSensor::translationChanged, Archon::X3D::SFRotation::type, Archon::X3D::SFVec2f::type, Archon::X3D::SFVec3f::type, Archon::X3D::SFTime::type, Archon::X3D::SFBool::type, and Archon::X3D::RenderConfig::wireframeMode.

Referenced by Archon::Console3d::viewScene().

void Archon::X3D::Viewer::resetViewpoint string  initialViewpointName,
const CoordSystem3x3 defaultViewpoint
 

This requires that you pass the same 'initialViewpointName' and 'defaultViewpoint' as you did to the constructor.

Definition at line 1263 of file view.C.

References bindViewpoint(), and Archon::Utilities::Ref< T >::get().

Referenced by Archon::Console3d::ViewState::resetViewpoint().

void Archon::X3D::Viewer::setPointingDevicePosition2D Vector2   ) 
 

Use this method for convetional 2-D mouse.

Only call this method when the position of the mouse changes.

Definition at line 1293 of file view.C.

Referenced by Archon::Console3d::viewScene().


The documentation for this struct was generated from the following files:
Generated on Sun Jul 30 23:01:27 2006 for Archon by  doxygen 1.4.4