Updated wrappers.

This commit is contained in:
Robert Osfield 2005-11-17 17:45:04 +00:00
parent 35fcaf7bde
commit 39db6b28b3
5 changed files with 81 additions and 48 deletions

View File

@ -85,37 +85,37 @@ void ellipsodeTransformTest(double latitude, double longitude, double height)
}
void processFile(std::string filename,
osgTerrain::DataSet::Source::Type type,
std::string currentCS,
osg::Matrixd &geoTransform,
bool geoTransformSet,
bool geoTransformScale,
osgTerrain::DataSet::Source::Type type,
std::string currentCS,
osg::Matrixd &geoTransform,
bool geoTransformSet,
bool geoTransformScale,
bool minmaxLevelSet, unsigned int min_level, unsigned int max_level,
unsigned int layerNum,
osg::ref_ptr<osgTerrain::DataSet> dataset) {
osg::ref_ptr<osgTerrain::DataSet> dataset) {
if(filename.empty()) return;
if(osgDB::fileType(filename) == osgDB::REGULAR_FILE) {
osgTerrain::DataSet::Source* source = new osgTerrain::DataSet::Source(type, filename);
if (source)
{
if (!currentCS.empty())
{
std::cout<<"source->setCoordySystem "<<currentCS<<std::endl;
source->setCoordinateSystemPolicy(osgTerrain::DataSet::Source::PREFER_CONFIG_SETTINGS);
source->setCoordinateSystem(currentCS);
}
if (geoTransformSet)
{
std::cout<<"source->setGeoTransform "<<geoTransform<<std::endl;
source->setGeoTransformPolicy(geoTransformScale ?
osgTerrain::DataSet::Source::PREFER_CONFIG_SETTINGS_BUT_SCALE_BY_FILE_RESOLUTION :
osgTerrain::DataSet::Source::PREFER_CONFIG_SETTINGS);
source->setGeoTransform(geoTransform);
}
osgTerrain::DataSet::Source* source = new osgTerrain::DataSet::Source(type, filename);
if (source)
{
if (!currentCS.empty())
{
std::cout<<"source->setCoordySystem "<<currentCS<<std::endl;
source->setCoordinateSystemPolicy(osgTerrain::DataSet::Source::PREFER_CONFIG_SETTINGS);
source->setCoordinateSystem(currentCS);
}
if (geoTransformSet)
{
std::cout<<"source->setGeoTransform "<<geoTransform<<std::endl;
source->setGeoTransformPolicy(geoTransformScale ?
osgTerrain::DataSet::Source::PREFER_CONFIG_SETTINGS_BUT_SCALE_BY_FILE_RESOLUTION :
osgTerrain::DataSet::Source::PREFER_CONFIG_SETTINGS);
source->setGeoTransform(geoTransform);
}
if (minmaxLevelSet)
{
source->setMinMaxLevel(min_level, max_level);
@ -124,26 +124,26 @@ void processFile(std::string filename,
source->setLayer(layerNum);
std::cout<<"Reading as layer = "<<layerNum<<std::endl;
dataset->addSource(source);
}
dataset->addSource(source);
}
} else if (osgDB::fileType(filename) == osgDB::DIRECTORY) {
osgDB::DirectoryContents dirContents= osgDB::getDirectoryContents(filename);
// loop through directory contents and call processFile
std::vector<std::string>::iterator i;
std::string fullfilename;
for(i = dirContents.begin(); i != dirContents.end(); ++i) {
if((*i != ".") && (*i != "..")) {
fullfilename = filename + '/' + *i;
processFile(fullfilename, type, currentCS,
osgDB::DirectoryContents dirContents= osgDB::getDirectoryContents(filename);
// loop through directory contents and call processFile
std::vector<std::string>::iterator i;
std::string fullfilename;
for(i = dirContents.begin(); i != dirContents.end(); ++i) {
if((*i != ".") && (*i != "..")) {
fullfilename = filename + '/' + *i;
processFile(fullfilename, type, currentCS,
geoTransform, geoTransformSet, geoTransformScale,
minmaxLevelSet, min_level, max_level,
layerNum,
dataset);
}
}
}
}
}
}
@ -514,8 +514,8 @@ int main( int argc, char **argv )
else if (arguments.read(pos, "-d",filename))
{
std::cout<<"-d "<<filename<<std::endl;
processFile(filename, osgTerrain::DataSet::Source::HEIGHT_FIELD, currentCS,
std::cout<<"-d "<<filename<<std::endl;
processFile(filename, osgTerrain::DataSet::Source::HEIGHT_FIELD, currentCS,
geoTransform, geoTransformSet, geoTransformScale,
minmaxLevelSet, min_level, max_level,
currentLayerNum,
@ -533,8 +533,8 @@ int main( int argc, char **argv )
}
else if (arguments.read(pos, "-t",filename))
{
std::cout<<"-t "<<filename<<std::endl;
processFile(filename, osgTerrain::DataSet::Source::IMAGE, currentCS,
std::cout<<"-t "<<filename<<std::endl;
processFile(filename, osgTerrain::DataSet::Source::IMAGE, currentCS,
geoTransform, geoTransformSet, geoTransformScale,
minmaxLevelSet, min_level, max_level,
currentLayerNum,
@ -552,8 +552,8 @@ int main( int argc, char **argv )
/*
else if (arguments.read(pos, "-m",filename))
{
std::cout<<"-m "<<filename<<std::endl;
processFile(filename, osgTerrain::DataSet::Source::MODEL, currentCS,
std::cout<<"-m "<<filename<<std::endl;
processFile(filename, osgTerrain::DataSet::Source::MODEL, currentCS,
geoTransform, geoTransformSet, geoTransformScale,
minmaxLevelSet, min_level, max_level,
currentLayerNum,

View File

@ -40,10 +40,19 @@ BEGIN_OBJECT_REFLECTOR(osgGA::DriveManipulator)
I_Method2(void, init, IN, const osgGA::GUIEventAdapter &, ea, IN, osgGA::GUIActionAdapter &, us);
I_Method2(bool, handle, IN, const osgGA::GUIEventAdapter &, ea, IN, osgGA::GUIActionAdapter &, us);
I_Method1(void, getUsage, IN, osg::ApplicationUsage &, usage);
I_Method1(void, setModelScale, IN, double, in_ms);
I_Method0(double, getModelScale);
I_Method1(void, setVelocity, IN, double, in_vel);
I_Method0(double, getVelocity);
I_Method1(void, setHeight, IN, double, in_h);
I_Method0(double, getHeight);
I_WriteOnlyProperty(const osg::Matrixd &, ByInverseMatrix);
I_WriteOnlyProperty(const osg::Matrixd &, ByMatrix);
I_Property(double, Height);
I_ReadOnlyProperty(osg::Matrixd, InverseMatrix);
I_ReadOnlyProperty(osg::Matrixd, Matrix);
I_Property(double, ModelScale);
I_Property(osg::Node *, Node);
I_Property(double, Velocity);
END_REFLECTOR

View File

@ -45,11 +45,20 @@ BEGIN_OBJECT_REFLECTOR(osgGA::FlightManipulator)
I_Method2(bool, handle, IN, const osgGA::GUIEventAdapter &, ea, IN, osgGA::GUIActionAdapter &, us);
I_Method1(void, getUsage, IN, osg::ApplicationUsage &, usage);
I_Method1(void, setYawControlMode, IN, osgGA::FlightManipulator::YawControlMode, ycm);
I_Method1(void, setModelScale, IN, double, in_ms);
I_Method0(double, getModelScale);
I_Method1(void, setAcceleration, IN, double, in_acc);
I_Method0(double, getAcceleration);
I_Method1(void, setVelocity, IN, double, in_vel);
I_Method0(double, getVelocity);
I_Property(double, Acceleration);
I_WriteOnlyProperty(const osg::Matrixd &, ByInverseMatrix);
I_WriteOnlyProperty(const osg::Matrixd &, ByMatrix);
I_ReadOnlyProperty(osg::Matrixd, InverseMatrix);
I_ReadOnlyProperty(osg::Matrixd, Matrix);
I_Property(double, ModelScale);
I_Property(osg::Node *, Node);
I_Property(double, Velocity);
I_WriteOnlyProperty(osgGA::FlightManipulator::YawControlMode, YawControlMode);
END_REFLECTOR

View File

@ -29,8 +29,6 @@ BEGIN_OBJECT_REFLECTOR(osgGA::TrackballManipulator)
I_BaseType(osgGA::MatrixManipulator);
I_Constructor0();
I_Method0(const char *, className);
I_Method1(void, setMinimumZoomScale, IN, float, minimumZoomScale);
I_Method0(float, getMinimumZoomScale);
I_Method1(void, setByMatrix, IN, const osg::Matrixd &, matrix);
I_Method1(void, setByInverseMatrix, IN, const osg::Matrixd &, matrix);
I_Method0(osg::Matrixd, getMatrix);
@ -45,6 +43,8 @@ BEGIN_OBJECT_REFLECTOR(osgGA::TrackballManipulator)
I_Method2(void, init, IN, const osgGA::GUIEventAdapter &, ea, IN, osgGA::GUIActionAdapter &, us);
I_Method2(bool, handle, IN, const osgGA::GUIEventAdapter &, ea, IN, osgGA::GUIActionAdapter &, us);
I_Method1(void, getUsage, IN, osg::ApplicationUsage &, usage);
I_Method1(void, setMinimumZoomScale, IN, double, minimumZoomScale);
I_Method0(double, getMinimumZoomScale);
I_Method1(void, setTrackballSize, IN, float, size);
I_Method0(float, getTrackballSize);
I_WriteOnlyProperty(const osg::Matrixd &, ByInverseMatrix);
@ -53,7 +53,7 @@ BEGIN_OBJECT_REFLECTOR(osgGA::TrackballManipulator)
I_ReadOnlyProperty(float, FusionDistanceValue);
I_ReadOnlyProperty(osg::Matrixd, InverseMatrix);
I_ReadOnlyProperty(osg::Matrixd, Matrix);
I_Property(float, MinimumZoomScale);
I_Property(double, MinimumZoomScale);
I_Property(osg::Node *, Node);
I_Property(float, TrackballSize);
END_REFLECTOR

View File

@ -43,10 +43,25 @@ BEGIN_OBJECT_REFLECTOR(osgGA::UFOManipulator)
I_Method2(bool, handle, IN, const osgGA::GUIEventAdapter &, ea, IN, osgGA::GUIActionAdapter &, aa);
I_Method1(void, getUsage, IN, osg::ApplicationUsage &, usage);
I_Method3(void, getCurrentPositionAsLookAt, IN, osg::Vec3 &, eye, IN, osg::Vec3 &, center, IN, osg::Vec3 &, up);
I_Method1(void, setMinHeight, IN, double, in_min_height);
I_Method0(double, getMinHeight);
I_Method1(void, setMinDistance, IN, double, in_min_dist);
I_Method0(double, getMinDistance);
I_Method1(void, setForwardSpeed, IN, double, in_fs);
I_Method0(double, getForwardSpeed);
I_Method1(void, setSideSpeed, IN, double, in_ss);
I_Method0(double, getSideSpeed);
I_Method1(void, setRotationSpeed, IN, double, in_rot_speed);
I_Method0(double, getRotationSpeed);
I_WriteOnlyProperty(const osg::Matrixd &, ByInverseMatrix);
I_WriteOnlyProperty(const osg::Matrixd &, ByMatrix);
I_Property(double, ForwardSpeed);
I_ReadOnlyProperty(osg::Matrixd, InverseMatrix);
I_ReadOnlyProperty(osg::Matrixd, Matrix);
I_Property(double, MinDistance);
I_Property(double, MinHeight);
I_Property(osg::Node *, Node);
I_Property(double, RotationSpeed);
I_Property(double, SideSpeed);
END_REFLECTOR