Skip to content

Commit

Permalink
Vrui 3.0-002
Browse files Browse the repository at this point in the history
Fixed one minor oversight, and one doozy.
  • Loading branch information
chebee7i committed Aug 22, 2013
1 parent 2a62ef5 commit cc80728
Show file tree
Hide file tree
Showing 109 changed files with 2,039 additions and 667 deletions.
6 changes: 3 additions & 3 deletions BuildRoot/BasicMakefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
########################################################################
# BasicMakefile - Definitions and rules to build object files, shared
# and static libraries, and executables.
# Copyright (c) 1999-2012 Oliver Kreylos
# Copyright (c) 1999-2013 Oliver Kreylos
# Mac OS X adaptation copyright (c) 2006 Braden Pellett
#
# This file is part of the WhyTools Build Environment.
Expand Down Expand Up @@ -245,10 +245,10 @@ endif
%: %.cpp
@mkdir -p $(EXEDIR)/$(*D)
ifdef SHOWCOMMAND
$(CCOMP) -o $(EXEDIR)/$@ $(CCFLAGS) $(filter %.o,$^) $(LINKFLAGS) $(LINKDIRFLAGS) $(LINKLIBFLAGS)
$(CCOMP) -o $(EXEDIR)/$@ $(CCFLAGS) $(filter %.cpp,$^) $(LINKFLAGS) $(LINKDIRFLAGS) $(LINKLIBFLAGS)
else
@echo Compiling and linking $<...
@$(CCOMP) -o $(EXEDIR)/$@ $(CCFLAGS) $(filter %.o,$^) $(LINKFLAGS) $(LINKDIRFLAGS) $(LINKLIBFLAGS)
@$(CCOMP) -o $(EXEDIR)/$@ $(CCFLAGS) $(filter %.cpp,$^) $(LINKFLAGS) $(LINKDIRFLAGS) $(LINKLIBFLAGS)
endif

#
Expand Down
6 changes: 3 additions & 3 deletions BuildRoot/Packages.Vrui
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
########################################################################
# Packages.Vrui - List of Vrui sub-packages that can be included/linked
# into projects.
# Copyright (c) 1999-2011 Oliver Kreylos
# Copyright (c) 1999-2013 Oliver Kreylos
# Mac OS X adaptation copyright (c) 2006 Braden Pellett
#
# This file is part of the WhyTools Build Environment.
Expand Down Expand Up @@ -80,7 +80,7 @@ MYMATH_LIBDIR = -L$(VRUI_LIBDIR)
MYMATH_LIBS = -lMath.$(LDEXT)

MYGEOMETRY_BASEDIR = $(VRUI_PACKAGEROOT)
MYGEOMETRY_DEPENDS = MYMATH MYTHREADS MYMISC
MYGEOMETRY_DEPENDS = MYMATH MYIO MYTHREADS MYMISC
MYGEOMETRY_INCLUDE = -I$(VRUI_INCLUDEDIR)
MYGEOMETRY_LIBDIR = -L$(VRUI_LIBDIR)
MYGEOMETRY_LIBS = -lGeometry.$(LDEXT)
Expand All @@ -100,7 +100,7 @@ MYGLSUPPORT_LIBDIR = -L$(VRUI_LIBDIR)
MYGLSUPPORT_LIBS = -lGLSupport.$(LDEXT)

MYGLXSUPPORT_BASEDIR = $(VRUI_PACKAGEROOT)
MYGLXSUPPORT_DEPENDS = MYMISC GL X11
MYGLXSUPPORT_DEPENDS = MYGLSUPPORT MYMISC GL X11
MYGLXSUPPORT_INCLUDE = -I$(VRUI_INCLUDEDIR)
MYGLXSUPPORT_CFLAGS = $(SYSTEM_GET_GLEXT_PROTOTYPES)
MYGLXSUPPORT_LIBDIR = -L$(VRUI_LIBDIR)
Expand Down
4 changes: 2 additions & 2 deletions BuildRoot/makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
########################################################################
# Makefile template for inter-platform development with automatic
# source dependency maintenance.
# Copyright (c) 1999-2012 Oliver Kreylos
# Copyright (c) 1999-2013 Oliver Kreylos
#
# This file is part of the WhyTools Build Environment.
#
Expand All @@ -22,7 +22,7 @@
########################################################################

# Set directory containing Vrui's build system:
VRUI_MAKEDIR := $(HOME)/Vrui-2.6/share/make
VRUI_MAKEDIR := $(HOME)/Vrui-2.7/share/make
ifdef DEBUG
VRUI_MAKEDIR = $(VRUI_MAKEDIR)/debug
endif
Expand Down
4 changes: 2 additions & 2 deletions Calibration/AlignTrackingMarkers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
AlignTrackingMarkers - Utility to define a reasonable coordinate system
based on tracking marker positions detected by an optical tracking
system.
Copyright (c) 2008-2010 Oliver Kreylos
Copyright (c) 2008-2013 Oliver Kreylos
This file is part of the Vrui calibration utility package.
Expand Down Expand Up @@ -629,7 +629,7 @@ void AlignTrackingMarkers::display(GLContextData& contextData) const
axis/=height;
Vector x=Geometry::normal(axis);
x.normalize();
Vector y=Geometry::cross(axis,x);
Vector y=axis^x;
y.normalize();
glBegin(GL_QUAD_STRIP);
glColor3f(0.5f,0.5f,0.5f);
Expand Down
28 changes: 20 additions & 8 deletions Calibration/MeasureEnvironment.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/***********************************************************************
MeasureEnvironment - Utility for guided surveys of a single-screen
VR environment using a Total Station.
Copyright (c) 2009-2012 Oliver Kreylos
Copyright (c) 2009-2013 Oliver Kreylos
This file is part of the Vrui calibration utility package.
Expand Down Expand Up @@ -121,21 +121,33 @@ const Vrui::ToolFactory* MeasureEnvironment::PointSnapperTool::getFactory(void)
void MeasureEnvironment::PointSnapperTool::frame(void)
{
/* Pick a point: */
Vrui::NavTrackerState transform=Vrui::getDeviceTransformation(sourceDevice);
Point pos=transform.getOrigin();
PickResult pr;
if(sourceDevice->isRayDevice())
pr=application->pickPoint(Ray(pos,transform.transform(sourceDevice->getDeviceRayDirection())));
{
/* Calculate the device's selection ray in navigational coordinates: */
Ray ray(sourceDevice->getRay());
ray.transform(Vrui::getInverseNavigationTransformation());

/* Pick a point along a ray: */
pr=application->pickPoint(ray);
}
else
{
/* Calculate the device's selection position in navigational coordinates: */
Point pos(Vrui::getInverseNavigationTransformation().transform(sourceDevice->getPosition()));

/* Pick a point: */
pr=application->pickPoint(pos);
}

/* Move the device's origin to the picked point: */
pos=application->snapToPoint(pos,pr);
Point devicePos(sourceDevice->getPosition());
devicePos=application->snapToPoint(devicePos,pr);

/* Set the transformed device's position to the intersection point: */
Vrui::TrackerState ts=Vrui::TrackerState::translateFromOriginTo(Vrui::getNavigationTransformation().transform(pos));
transformedDevice->setDeviceRay(sourceDevice->getDeviceRayDirection(),sourceDevice->getDeviceRayStart());
Vrui::TrackerState ts(Vrui::getNavigationTransformation().transform(devicePos)-Vrui::Point::origin,sourceDevice->getOrientation());
transformedDevice->setTransformation(ts);
transformedDevice->setDeviceRayDirection(sourceDevice->getDeviceRayDirection());
}

/***********************************************************
Expand Down Expand Up @@ -1107,7 +1119,7 @@ void MeasureEnvironment::createTransformationCallback(Misc::CallbackData* cbData

/* Orthonormalize the screen normal against the floor normal: */
Point::Vector y=screenNormal-floorNormal*((screenNormal*floorNormal)/Geometry::sqr(floorNormal));
Point::Vector x=Geometry::cross(y,floorNormal);
Point::Vector x=y^floorNormal;

/* Calculate a rotation to align the floor normal with +z and the (horizontal) screen normal with +y: */
OGTransform::Rotation rot=OGTransform::Rotation::fromBaseVectors(x,y);
Expand Down
2 changes: 1 addition & 1 deletion Calibration/MeasureEnvironment.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/***********************************************************************
MeasureEnvironment - Utility for guided surveys of a single-screen
VR environment using a Total Station.
Copyright (c) 2009-2012 Oliver Kreylos
Copyright (c) 2009-2013 Oliver Kreylos
This file is part of the Vrui calibration utility package.
Expand Down
6 changes: 4 additions & 2 deletions Calibration/ScreenCalibrator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
ScreenCalibrator - Utility to create a calibration transformation
between Vrui's physical coordinate system and a tracking system's
internal coordinate system.
Copyright (c) 2009-2010 Oliver Kreylos
Copyright (c) 2009-2013 Oliver Kreylos
This file is part of the Vrui calibration utility package.
Expand Down Expand Up @@ -501,10 +501,12 @@ ScreenCalibrator::ScreenCalibrator(int& argc,char**& argv,char**& appDefaults)

/* Orthonormalize the screen normal against the floor normal: */
Vector y=screenNormal-floorNormal*((screenNormal*floorNormal)/Geometry::sqr(floorNormal));
Vector x=Geometry::cross(y,floorNormal);
Vector x=y^floorNormal;

#if 0
/* Calculate a rotation to align the floor normal with +z and the (horizontal) screen normal with +y: */
ONTransform::Rotation rot=ONTransform::Rotation::fromBaseVectors(x,y);
#endif

/*********************************************************************
Calculate a transformation to move the Totalstation survey points into
Expand Down
38 changes: 29 additions & 9 deletions Cluster/StandardDirectory.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/***********************************************************************
StandardDirectory - Pair of classes to access cluster-transparent
standard filesystem directories.
Copyright (c) 2011-2012 Oliver Kreylos
Copyright (c) 2011-2013 Oliver Kreylos
This file is part of the Cluster Abstraction Library (Cluster).
Expand Down Expand Up @@ -120,10 +120,20 @@ Misc::PathType StandardDirectory::getEntryType(void) const
IO::FilePtr StandardDirectory::openFile(const char* fileName,IO::File::AccessMode accessMode) const
{
/* Assemble the absolute path name of the given file: */
std::string filePath=pathName;
if(filePath.length()>1)
filePath.push_back('/');
filePath.append(fileName);
std::string filePath;
if(fileName[0]=='/')
{
/* Use the provided absolute file path: */
filePath=fileName;
}
else
{
/* Create a relative file path: */
filePath=pathName;
if(filePath.length()>1)
filePath.push_back('/');
filePath.append(fileName);
}

/* Open and return the file: */
return Cluster::openFile(pipe.getMultiplexer(),filePath.c_str(),accessMode);
Expand All @@ -132,10 +142,20 @@ IO::FilePtr StandardDirectory::openFile(const char* fileName,IO::File::AccessMod
IO::DirectoryPtr StandardDirectory::openDirectory(const char* directoryName) const
{
/* Assemble the absolute path name of the given directory: */
std::string directoryPath=pathName;
if(directoryPath.length()>1)
directoryPath.push_back('/');
directoryPath.append(directoryName);
std::string directoryPath;
if(directoryName[0]=='/')
{
/* Use the provided absolute path: */
directoryPath=directoryName;
}
else
{
/* Create a relative path: */
directoryPath=pathName;
if(directoryPath.length()>1)
directoryPath.push_back('/');
directoryPath.append(directoryName);
}

/* Return the new directory: */
if(pipe.getMultiplexer()->isMaster())
Expand Down
2 changes: 1 addition & 1 deletion Cluster/StandardDirectory.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/***********************************************************************
StandardDirectory - Pair of classes to access cluster-transparent
standard filesystem directories.
Copyright (c) 2011-2012 Oliver Kreylos
Copyright (c) 2011-2013 Oliver Kreylos
This file is part of the Cluster Abstraction Library (Cluster).
Expand Down
8 changes: 7 additions & 1 deletion Cluster/StandardFile.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/***********************************************************************
StandardFile - Pair of classes for high-performance cluster-transparent
reading/writing from/to standard operating system files.
Copyright (c) 2011-2012 Oliver Kreylos
Copyright (c) 2011-2013 Oliver Kreylos
This file is part of the Cluster Abstraction Library (Cluster).
Expand Down Expand Up @@ -141,6 +141,9 @@ void StandardFileMaster::writeData(const IO::File::Byte* buffer,size_t bufferSiz
errorType=1; // Seek error
}

/* Invalidate the read buffer to prevent reading stale data: */
flushReadBuffer();

/* Write all data in the given buffer: */
while(errorType==0&&bufferSize>0)
{
Expand Down Expand Up @@ -375,6 +378,9 @@ size_t StandardFileSlave::readData(IO::File::Byte* buffer,size_t bufferSize)

void StandardFileSlave::writeData(const IO::File::Byte* buffer,size_t bufferSize)
{
/* Invalidate the read buffer to prevent reading stale data: */
flushReadBuffer();

if(isWriteCoupled())
{
/* Receive a status packet from the master: */
Expand Down
2 changes: 1 addition & 1 deletion Cluster/StandardFile.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/***********************************************************************
StandardFile - Pair of classes for high-performance cluster-transparent
reading/writing from/to standard operating system files.
Copyright (c) 2011-2012 Oliver Kreylos
Copyright (c) 2011-2013 Oliver Kreylos
This file is part of the Cluster Abstraction Library (Cluster).
Expand Down
20 changes: 19 additions & 1 deletion Cluster/ThreadSynchronizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
ClusterSynchronizer - Helper class to synchronize the number of created
child threads of the current thread across a cluster, in order to ensure
multi-threaded pipe creation consistency.
Copyright (c) 2012 Oliver Kreylos
Copyright (c) 2012-2013 Oliver Kreylos
This file is part of the Cluster Abstraction Library (Cluster).
Expand Down Expand Up @@ -57,4 +57,22 @@ ThreadSynchronizer::~ThreadSynchronizer(void)
}
}

void ThreadSynchronizer::sync(void)
{
if(pipe!=0)
{
/* Get the number of child threads created since initialization: */
unsigned int numChildThreads=Threads::Thread::getThreadObject()->getNextChildIndex()-startChildThreadIndex;

/* Get the maximum number of created child threads for each cluster node: */
unsigned int maxNumChildThreads=pipe->gather(numChildThreads,Cluster::GatherOperation::MAX);

/* Synchronize the next child thread index: */
Threads::Thread::getThreadObject()->advanceNextChildIndex(maxNumChildThreads-numChildThreads);

/* Update the index of the next created child thread: */
startChildThreadIndex=Threads::Thread::getThreadObject()->getNextChildIndex();
}
}

}
5 changes: 4 additions & 1 deletion Cluster/ThreadSynchronizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
ClusterSynchronizer - Helper class to synchronize the number of created
child threads of the current thread across a cluster, in order to ensure
multi-threaded pipe creation consistency.
Copyright (c) 2012 Oliver Kreylos
Copyright (c) 2012-2013 Oliver Kreylos
This file is part of the Cluster Abstraction Library (Cluster).
Expand Down Expand Up @@ -42,6 +42,9 @@ class ThreadSynchronizer
public:
ThreadSynchronizer(MulticastPipe* sPipe); // Creates a thread synchronizer using the given cluster pipe; cluster pipe's lifetime must bracket this object's lifetime
~ThreadSynchronizer(void); // Synchronizes number of created child threads using the assigned cluster pipe

/* Methods: */
void sync(void); // Synchronizes number of created child threads using the assigned cluster pipe
};

}
Expand Down
Loading

0 comments on commit cc80728

Please sign in to comment.