Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
9.2.2023: Due to updates GitLab will be unavailable for some minutes between 9:00 and 11:00.
Open sidebar
CAMP
campvis-public
Commits
53ba5fe9
Commit
53ba5fe9
authored
Sep 27, 2013
by
Christian Schulte zu Berge
Browse files
Renamed TumVisPainter to CampVisPainter
parent
1a7539f2
Changes
4
Hide whitespace changes
Inline
Side-by-side
application/campvisapplication.cpp
View file @
53ba5fe9
...
...
@@ -78,7 +78,7 @@ namespace campvis {
tgtAssert
(
_initialized
==
false
,
"Destructing initialized CampVisApplication, deinitialize first!"
);
// delete everything in the right order:
for
(
std
::
vector
<
std
::
pair
<
VisualizationPipeline
*
,
Tum
VisPainter
*>
>::
iterator
it
=
_visualizations
.
begin
();
it
!=
_visualizations
.
end
();
++
it
)
{
for
(
std
::
vector
<
std
::
pair
<
VisualizationPipeline
*
,
Camp
VisPainter
*>
>::
iterator
it
=
_visualizations
.
begin
();
it
!=
_visualizations
.
end
();
++
it
)
{
delete
it
->
second
;
}
for
(
std
::
vector
<
AbstractPipeline
*>::
iterator
it
=
_pipelines
.
begin
();
it
!=
_pipelines
.
end
();
++
it
)
{
...
...
@@ -167,7 +167,7 @@ namespace campvis {
}
// Now init painters:
for
(
std
::
vector
<
std
::
pair
<
VisualizationPipeline
*
,
Tum
VisPainter
*>
>::
iterator
it
=
_visualizations
.
begin
();
it
!=
_visualizations
.
end
();
++
it
)
{
for
(
std
::
vector
<
std
::
pair
<
VisualizationPipeline
*
,
Camp
VisPainter
*>
>::
iterator
it
=
_visualizations
.
begin
();
it
!=
_visualizations
.
end
();
++
it
)
{
it
->
second
->
init
();
}
...
...
@@ -190,7 +190,7 @@ namespace campvis {
}
// Now deinit painters:
for
(
std
::
vector
<
std
::
pair
<
VisualizationPipeline
*
,
Tum
VisPainter
*>
>::
iterator
it
=
_visualizations
.
begin
();
it
!=
_visualizations
.
end
();
++
it
)
{
for
(
std
::
vector
<
std
::
pair
<
VisualizationPipeline
*
,
Camp
VisPainter
*>
>::
iterator
it
=
_visualizations
.
begin
();
it
!=
_visualizations
.
end
();
++
it
)
{
it
->
second
->
deinit
();
}
...
...
@@ -253,7 +253,7 @@ namespace campvis {
_mainWindow
->
addVisualizationPipelineWidget
(
name
,
canvas
);
canvas
->
init
();
Tum
VisPainter
*
painter
=
new
Tum
VisPainter
(
canvas
,
vp
);
Camp
VisPainter
*
painter
=
new
Camp
VisPainter
(
canvas
,
vp
);
canvas
->
setPainter
(
painter
,
false
);
_visualizations
.
push_back
(
std
::
make_pair
(
vp
,
painter
));
...
...
application/campvisapplication.h
View file @
53ba5fe9
...
...
@@ -45,7 +45,7 @@ namespace tgt {
namespace
campvis
{
class
AbstractPipeline
;
class
MainWindow
;
class
Tum
VisPainter
;
class
Camp
VisPainter
;
class
VisualizationPipeline
;
/**
...
...
@@ -132,7 +132,7 @@ namespace campvis {
/// All pipelines (incuding VisualizationPipelines)
std
::
vector
<
AbstractPipeline
*>
_pipelines
;
/// All visualisations (i.e. VisualizationPipelines with their corresponding painters/canvases)
std
::
vector
<
std
::
pair
<
VisualizationPipeline
*
,
Tum
VisPainter
*>
>
_visualizations
;
std
::
vector
<
std
::
pair
<
VisualizationPipeline
*
,
Camp
VisPainter
*>
>
_visualizations
;
/// A local OpenGL context used for initialization
tgt
::
QtThreadedCanvas
*
_localContext
;
...
...
application/campvispainter.cpp
View file @
53ba5fe9
...
...
@@ -47,9 +47,9 @@
#include
"core/tools/quadrenderer.h"
namespace
campvis
{
const
std
::
string
Tum
VisPainter
::
loggerCat_
=
"CAMPVis.core.
Tum
VisPainter"
;
const
std
::
string
Camp
VisPainter
::
loggerCat_
=
"CAMPVis.core.
Camp
VisPainter"
;
Tum
VisPainter
::
Tum
VisPainter
(
tgt
::
GLCanvas
*
canvas
,
VisualizationPipeline
*
pipeline
)
Camp
VisPainter
::
Camp
VisPainter
(
tgt
::
GLCanvas
*
canvas
,
VisualizationPipeline
*
pipeline
)
:
Runnable
()
,
tgt
::
Painter
(
canvas
)
,
_pipeline
(
0
)
...
...
@@ -60,11 +60,11 @@ namespace campvis {
setPipeline
(
pipeline
);
}
Tum
VisPainter
::~
Tum
VisPainter
()
{
Camp
VisPainter
::~
Camp
VisPainter
()
{
}
void
Tum
VisPainter
::
stop
()
{
void
Camp
VisPainter
::
stop
()
{
// we need to execute run() one more time to ensure correct release of the OpenGL context
_stopExecution
=
true
;
_renderCondition
.
notify_all
();
...
...
@@ -72,7 +72,7 @@ namespace campvis {
Runnable
::
stop
();
}
void
Tum
VisPainter
::
run
()
{
void
Camp
VisPainter
::
run
()
{
std
::
unique_lock
<
tbb
::
mutex
>
lock
(
CtxtMgr
.
getGlMutex
());
while
(
!
_stopExecution
)
{
...
...
@@ -89,7 +89,7 @@ namespace campvis {
CtxtMgr
.
releaseCurrentContext
();
}
void
Tum
VisPainter
::
paint
()
{
void
Camp
VisPainter
::
paint
()
{
if
(
getCanvas
()
==
0
)
return
;
...
...
@@ -150,11 +150,11 @@ namespace campvis {
getCanvas
()
->
swap
();
}
void
Tum
VisPainter
::
sizeChanged
(
const
tgt
::
ivec2
&
size
)
{
void
Camp
VisPainter
::
sizeChanged
(
const
tgt
::
ivec2
&
size
)
{
_pipeline
->
setRenderTargetSize
(
size
);
}
void
Tum
VisPainter
::
init
()
{
void
Camp
VisPainter
::
init
()
{
try
{
// TODO: Remove hardcoded paths, and use ShdrMgr.addPath() at some central location
_copyShader
=
ShdrMgr
.
loadSeparate
(
"core/glsl/passthrough.vert"
,
"core/glsl/copyimage.frag"
,
""
,
false
);
...
...
@@ -164,7 +164,7 @@ namespace campvis {
}
}
void
Tum
VisPainter
::
deinit
()
{
void
Camp
VisPainter
::
deinit
()
{
ShdrMgr
.
dispose
(
_copyShader
);
if
(
_pipeline
!=
0
)
{
...
...
@@ -175,7 +175,7 @@ namespace campvis {
}
}
void
Tum
VisPainter
::
setPipeline
(
VisualizationPipeline
*
pipeline
)
{
void
Camp
VisPainter
::
setPipeline
(
VisualizationPipeline
*
pipeline
)
{
tgtAssert
(
pipeline
!=
0
,
"The given pipeline must not be 0."
);
if
(
_pipeline
!=
0
)
{
_pipeline
->
s_renderTargetChanged
.
disconnect
(
this
);
...
...
@@ -184,21 +184,21 @@ namespace campvis {
}
_pipeline
=
pipeline
;
_pipeline
->
s_renderTargetChanged
.
connect
(
this
,
&
Tum
VisPainter
::
onRenderTargetChanged
);
_pipeline
->
s_renderTargetChanged
.
connect
(
this
,
&
Camp
VisPainter
::
onRenderTargetChanged
);
_pipeline
->
setRenderTargetSize
(
getCanvas
()
->
getSize
());
if
(
getCanvas
()
->
getEventHandler
()
!=
0
)
getCanvas
()
->
getEventHandler
()
->
addEventListenerToFront
(
_pipeline
);
}
void
Tum
VisPainter
::
repaint
()
{
GLJobProc
.
enqueueJob
(
getCanvas
(),
makeJobOnHeap
(
this
,
&
Tum
VisPainter
::
paint
),
OpenGLJobProcessor
::
PaintJob
);
void
Camp
VisPainter
::
repaint
()
{
GLJobProc
.
enqueueJob
(
getCanvas
(),
makeJobOnHeap
(
this
,
&
Camp
VisPainter
::
paint
),
OpenGLJobProcessor
::
PaintJob
);
}
void
Tum
VisPainter
::
onRenderTargetChanged
()
{
void
Camp
VisPainter
::
onRenderTargetChanged
()
{
repaint
();
}
void
Tum
VisPainter
::
setCanvas
(
tgt
::
GLCanvas
*
canvas
)
{
void
Camp
VisPainter
::
setCanvas
(
tgt
::
GLCanvas
*
canvas
)
{
tgtAssert
(
dynamic_cast
<
tgt
::
QtThreadedCanvas
*>
(
canvas
)
!=
0
,
"Canvas must be of type QtThreadedCanvas!"
);
Painter
::
setCanvas
(
canvas
);
}
...
...
application/campvispainter.h
View file @
53ba5fe9
...
...
@@ -55,19 +55,19 @@ namespace campvis {
*
* \sa Runnable, VisualizationPipeline
*/
class
Tum
VisPainter
:
public
Runnable
,
public
tgt
::
Painter
,
public
sigslot
::
has_slots
<>
{
class
Camp
VisPainter
:
public
Runnable
,
public
tgt
::
Painter
,
public
sigslot
::
has_slots
<>
{
public:
/**
* Creates a new
Tum
VisPainter rendering the render target of \a pipeline on \a canvas.
* Creates a new
Camp
VisPainter rendering the render target of \a pipeline on \a canvas.
* \param canvas Canvas to render on
* \param pipeline Pipeline to render
*/
Tum
VisPainter
(
tgt
::
GLCanvas
*
canvas
,
VisualizationPipeline
*
pipeline
);
Camp
VisPainter
(
tgt
::
GLCanvas
*
canvas
,
VisualizationPipeline
*
pipeline
);
/**
* Destructor, stops and waits for the rendering thread if it's still running.
*/
virtual
~
Tum
VisPainter
();
virtual
~
Camp
VisPainter
();
/// \see Runnable::stop
void
stop
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment