Commit 681f59cf authored by schultezub's avatar schultezub
Browse files

refactored TumVisApplication to CampVisApplication

git-svn-id: https://camplinux.in.tum.de/svn/campvis/trunk@327 bb408c1c-ae56-11e1-83d9-df6b3e0c105e
parent d89d1152
......@@ -40,7 +40,7 @@ using namespace campvis;
* \return 0 if program exited successfully
**/
int main(int argc, char** argv) {
TumVisApplication app(argc, argv);
CampVisApplication app(argc, argv);
//app.addVisualizationPipeline("SliceVis", new SliceVis());
app.addVisualizationPipeline("DVRVis", new DVRVis());
......
......@@ -50,9 +50,9 @@
namespace campvis {
const std::string TumVisApplication::loggerCat_ = "CAMPVis.application.TumVisApplication";
const std::string CampVisApplication::loggerCat_ = "CAMPVis.application.CampVisApplication";
TumVisApplication::TumVisApplication(int argc, char** argv, bool useOpenCL)
CampVisApplication::CampVisApplication(int argc, char** argv, bool useOpenCL)
: QApplication(argc, argv)
, _localContext(0)
, _mainWindow(0)
......@@ -70,8 +70,8 @@ namespace campvis {
OpenGLJobProcessor::init();
}
TumVisApplication::~TumVisApplication() {
tgtAssert(_initialized == false, "Destructing initialized TumVisApplication, deinitialize first!");
CampVisApplication::~CampVisApplication() {
tgtAssert(_initialized == false, "Destructing initialized CampVisApplication, deinitialize first!");
// delete everything in the right order:
for (std::vector<PipelineEvaluator*>::iterator it = _pipelineEvaluators.begin(); it != _pipelineEvaluators.end(); ++it) {
......@@ -85,8 +85,8 @@ namespace campvis {
}
}
void TumVisApplication::init() {
tgtAssert(_initialized == false, "Tried to initialize TumVisApplication twice.");
void CampVisApplication::init() {
tgtAssert(_initialized == false, "Tried to initialize CampVisApplication twice.");
// Init TGT
tgt::InitFeature::Features featureset = tgt::InitFeature::ALL;
......@@ -145,8 +145,8 @@ namespace campvis {
_initialized = true;
}
void TumVisApplication::deinit() {
tgtAssert(_initialized, "Tried to deinitialize uninitialized TumVisApplication.");
void CampVisApplication::deinit() {
tgtAssert(_initialized, "Tried to deinitialize uninitialized CampVisApplication.");
GLJobProc.stop();
......@@ -181,14 +181,14 @@ namespace campvis {
tgt::QtContextManager::deinit();
tgt::deinit();
// MainWindow dtor needs a valid TumVisApplication, so we need to call it here instead of during destruction.
// MainWindow dtor needs a valid CampVisApplication, so we need to call it here instead of during destruction.
delete _mainWindow;
_initialized = false;
}
int TumVisApplication::run() {
tgtAssert(_initialized, "Tried to run uninitialized TumVisApplication.");
int CampVisApplication::run() {
tgtAssert(_initialized, "Tried to run uninitialized CampVisApplication.");
// disconnect OpenGL context from this thread so that the other threads can acquire an OpenGL context.
CtxtMgr.releaseCurrentContext();
......@@ -211,7 +211,7 @@ namespace campvis {
return toReturn;
}
void TumVisApplication::addPipeline(AbstractPipeline* pipeline) {
void CampVisApplication::addPipeline(AbstractPipeline* pipeline) {
tgtAssert(_initialized == false, "Adding pipelines after initialization is currently not supported.");
tgtAssert(pipeline != 0, "Pipeline must not be 0.");
_pipelines.push_back(pipeline);
......@@ -222,7 +222,7 @@ namespace campvis {
s_PipelinesChanged();
}
void TumVisApplication::addVisualizationPipeline(const std::string& name, VisualizationPipeline* vp) {
void CampVisApplication::addVisualizationPipeline(const std::string& name, VisualizationPipeline* vp) {
tgtAssert(_initialized == false, "Adding pipelines after initialization is currently not supported.");
tgtAssert(vp != 0, "Pipeline must not be 0.");
......
......@@ -48,33 +48,33 @@ namespace campvis {
class VisualizationPipeline;
/**
* The TumVisApplication class wraps Pipelines, Evaluators and Painters all together and takes
* The CampVisApplication class wraps Pipelines, Evaluators and Painters all together and takes
* care about correctly handling all those instances.
*
* Intended usage is:
* 1. Create your TumVisApplication
* 1. Create your CampVisApplication
* 2. Add Pipelines and Visualizations as needed
* 3. call init()
* 4. call run()
* 5. call deinit()
* 6. You can now safely destroy your TumVisApplication
* 6. You can now safely destroy your CampVisApplication
*/
class TumVisApplication : QApplication {
class CampVisApplication : QApplication {
friend class MainWindow;
public:
/**
* Creates a new TumVisApplication.
* Creates a new CampVisApplication.
* \param argc number of passed arguments
* \param argv vector of arguments
* \param useOpenCL Flag, whether to use OpenCL (inits and deinits KissCL lib at the appropriate time).
*/
TumVisApplication(int argc, char** argv, bool useOpenCL = true);
CampVisApplication(int argc, char** argv, bool useOpenCL = true);
/**
* Destructor, make sure to call deinit() first.
*/
~TumVisApplication();
~CampVisApplication();
/**
* Initializes tgt, OpenGL, and all pipelines, evaluators and painters.
......@@ -131,7 +131,7 @@ namespace campvis {
/// Main window hosting GUI stuff
MainWindow* _mainWindow;
/// Flag, whether TumVisApplication was correctly initialized
/// Flag, whether CampVisApplication was correctly initialized
bool _initialized;
/// Flag, whether to use OpenCL (inits and deinits KissCL lib at the appropriate time).
......
......@@ -38,7 +38,7 @@
namespace campvis {
MainWindow::MainWindow(TumVisApplication* application)
MainWindow::MainWindow(CampVisApplication* application)
: QMainWindow()
, _application(application)
, _centralWidget(0)
......
......@@ -46,7 +46,7 @@ namespace campvis {
/**
* Main Window for the CAMPVis application.
* Wraps a nice Qt GUI around the TumVisApplication instance given during creation.
* Wraps a nice Qt GUI around the CampVisApplication instance given during creation.
*/
class MainWindow : public QMainWindow, public sigslot::has_slots<> {
Q_OBJECT;
......@@ -54,9 +54,9 @@ namespace campvis {
public:
/**
* Creates a new TumVis Main window for \a application.
* \param application TumVisApplication to create a GUI for.
* \param application CampVisApplication to create a GUI for.
*/
MainWindow(TumVisApplication* application);
MainWindow(CampVisApplication* application);
/**
* Destructor, make sure to call before destroying the application
......@@ -114,7 +114,7 @@ namespace campvis {
*/
void setup();
TumVisApplication* _application; ///< Pointer to the application hosting the whole stuff
CampVisApplication* _application; ///< Pointer to the application hosting the whole stuff
QWidget* _centralWidget; ///< Central widget of the MainWindow
PipelineTreeWidget* _pipelineWidget; ///< Widget for browsing the active pipelines
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment