Skip to content
Snippets Groups Projects
Commit f38d55f7 authored by Martin Piatka's avatar Martin Piatka
Browse files

initial

parents
No related branches found
No related tags found
No related merge requests found
FROM debian:bullseye
RUN apt-get update && apt-get install -y \
build-essential \
git \
cmake \
libgl1-mesa-dev \
libpng-dev \
libtiff-dev \
pkg-config \
libjpeg-dev \
libcurl4-openssl-dev \
libfreetype-dev \
libsdl2-dev \
libmxml-dev \
&& rm -rf /var/lib/apt/lists/*
COPY patches /src_dir/calvr_patches
WORKDIR /src_dir
RUN git clone 'https://github.com/openscenegraph/OpenSceneGraph.git'
WORKDIR /src_dir/OpenSceneGraph/build
RUN git checkout OpenSceneGraph-3.6.2 && cmake .. && make -j16 && make install && make clean
WORKDIR /src_dir
RUN git clone --depth 1 'https://github.com/IVCenter/calvr.git'
WORKDIR /src_dir/calvr/
RUN git apply /src_dir/calvr_patches/*
WORKDIR /src_dir/calvr/build
RUN cmake .. && make -j8 && make install && make clean
WORKDIR /src_dir
RUN git clone --depth 1 'https://github.com/IVCenter/calvr_plugins.git'
WORKDIR /src_dir/calvr_plugins/build
RUN cmake .. -DCALVR_DIR=/usr/local -DCALVR_INCLUDE_DIR=/usr/local -DPLUGIN_PANOVIEW=ON && make -j8 && make install && make clean
RUN groupadd -g 1000 kiosk
RUN useradd -m -s /bin/bash -g 1000 -u 1000 kiosk
RUN printf "/usr/local/lib64\n/usr/local/lib\n/usr/local/lib/plugins" > /etc/ld.so.conf.d/calvr_libs.conf
USER 1000:1000
ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES graphics,utility,compute
<?xml version="1.0"?>
<Background g="0.0" a="0.0" />
<Stencil value="true" />
<MultiThreaded value="CullDrawThreadPerContext" />
<PreSwapOperation value="FINISH" />
<SyncToVBlank value="On" />
<Near value="100"/>
<Far value="100000000" />
<CullingMode value="CALVR" /> <!-- CALVR | DEFAULT -->
<MultiSample value="4" />
<ShowAxis value="off" />
<ConfigDebug value="false" />
<EventDebug value="false" />
<Input>
<TrackingDebug value="false" />
<TrackingSystem0 value="MOUSE">
<Offset x="0" y="0" z="0" />
<Orientation h="0" p="0" r="0" />
<NumBodies value="1" />
<NumButtons value="3" />
<NumValuators value="1" />
<Body0>
<Offset x="0" y="0" z="0" />
<Orientation h="0" p="0" r="0" />
</Body0>
</TrackingSystem0>
<NumHeads value="0" />
<Head0Address system="0" body="0" />
<NumHands value="1" />
<Hand0>
<Address system="0" body="0" />
<ButtonMask system0="0xF" />
<Valuator0 system="0" number="0" type="NON_ZERO" />
</Hand0>
</Input>
<Plugin>
<PanoView360 value="on">
<FloorOffset value="1500" />
<SpinScale value="0.25" />
<ScreenConfig value="/home/kiosk/calvr_home/xpol.xml" />
<RenderOnMaster value="true" />
<Files>
<TEST reye="/home/kiosk/calvr_home/data/luxor/right.tif" leye="/home/kiosk/calvr_home/data/luxor/left.tif" radius="9144" viewanglev="180" viewangleh="360" camHeight="-1128.0" segments="30" tsize="4096" sphere="1" />
<Luxor-columns reye="/home/kiosk/calvr_home/data/luxor-columns/right.tif" leye="/home/kiosk/calvr_home/data/luxor-columns/left.tif" radius="9144" viewanglev="180" viewangleh="360" camHeight="-1128.0" segments="30" tsize="8192" sphere="1" />
<Luxor-night reye="/home/kiosk/calvr_home/data/luxor-night/right.tif" leye="/home/kiosk/calvr_home/data/luxor-night/left.tif" radius="9144" viewanglev="180" viewangleh="360" camHeight="-1128.0" segments="30" tsize="4076" sphere="1" />
<Luxor-huge reye="/home/kiosk/calvr_home/data/luxor-huge/right.tif" leye="/home/kiosk/calvr_home/data/luxor-huge/left.tif" radius="9144" viewanglev="180" viewangleh="360" camHeight="-1128.0" segments="30" tsize="6144" sphere="1" />
</Files>
</PanoView360>
</Plugin>
<ContextMenus>
<Scale value="0.4" />
<MinDistance value="750" />
<MaxDistance value="1500" />
<DefaultOpenButton value="1" />
</ContextMenus>
<MenuSystem type="BOARDMENU">
<BoardMenu>
<Position distance="3000" />
<Scale value="1.0" />
<Buttons select="0" open="1" />
<Trigger value="DOUBLECLICK" />
</BoardMenu>
</MenuSystem>
<ViewerPosition x="0" y="-3000" z="0" />
<SceneSize value="1000" />
<NumPipes value="1" />
<NumWindows value="6" />
<NumScreens value="6" />
<PipeConfig>
<Pipe server="0" screen="0" name="0" />
<Pipe server="0" screen="1" name="1" />
<Pipe server="0" screen="3" name="3" />
<Pipe server="0" screen="4" name="4" />
<Pipe server="0" screen="5" name="5" />
</PipeConfig>
<ChannelConfig>
<Channel width="1200" height="1920" left="0" bottom="0" comment="MAIN" stereoMode="MONO" windowIndex="0" name="0" />
<Channel width="1200" height="1920" left="0" bottom="0" comment="MAIN" stereoMode="MONO" windowIndex="1" name="1" />
<Channel width="1200" height="1920" left="0" bottom="0" comment="MAIN" stereoMode="MONO" windowIndex="2" name="2" />
<Channel width="1200" height="1920" left="0" bottom="0" comment="MAIN" stereoMode="MONO" windowIndex="3" name="3" />
<Channel width="1200" height="1920" left="0" bottom="0" comment="MAIN" stereoMode="MONO" windowIndex="4" name="4" />
<Channel width="1200" height="1920" left="0" bottom="0" comment="MAIN" stereoMode="MONO" windowIndex="5" name="5" />
</ChannelConfig>
<WindowConfig>
<Window width="1200" comment="FRONT" pipeIndex="0" height="1920" left="0" bottom="0" name="0" decoration="true" overrideRedirect="false" cudaDevice="0" />
<Window width="1200" comment="FRONT" pipeIndex="0" height="1920" left="0" bottom="0" name="1" decoration="true" cudaDevice="0" />
<Window width="1200" comment="FRONT" pipeIndex="0" height="1920" left="0" bottom="0" name="2" decoration="true" cudaDevice="0" />
<Window width="1200" comment="FRONT" pipeIndex="0" height="1920" left="0" bottom="0" name="3" decoration="true" cudaDevice="0" />
<Window width="1200" comment="FRONT" pipeIndex="0" height="1920" left="0" bottom="0" name="4" decoration="true" cudaDevice="0" />
<Window width="1200" comment="FRONT" pipeIndex="0" height="1920" left="0" bottom="0" name="5" decoration="true" cudaDevice="0" />
</WindowConfig>
<ScreenConfig>
<Screen width="1200" comment="FRONT" h="0.0" originX="-1311" originY="0" originZ="0" height="1920" p="0.0" r="0.0" name="0" />
<Screen width="1200" comment="FRONT" h="0.0" originX="0" originY="0" originZ="0" height="1920" p="0.0" r="0.0" name="1" />
<Screen width="1200" comment="FRONT" h="0.0" originX="1311" originY="0" originZ="0" height="1920" p="0.0" r="0.0" name="2" />
<Screen width="1200" comment="FRONT" h="0.0" originX="-1311" originY="0" originZ="-1977" height="1920" p="0.0" r="0.0" name="3" />
<Screen width="1200" comment="FRONT" h="0.0" originX="0" originY="0" originZ="-1977" height="1920" p="0.0" r="0.0" name="4" />
<Screen width="1200" comment="FRONT" h="0.0" originX="1311" originY="0" originZ="-1977" height="1920" p="0.0" r="0.0" name="5" />
</ScreenConfig>
version: "2.3"
services:
calvr:
user: 1000:1000
runtime: nvidia
entrypoint: CalVR
build:
context: .
args:
- XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR}
- USER=${USER}
environment:
- XAUTHORITY=${XAUTHORITY}
- XAUTHLOCALHOSTNAME=${HOSTNAME}
- CALVR_HOME=${HOME}/calvr_home
- CALVR_CONFIG_FILE=config.xml
- DISPLAY=${DISPLAY}
- NVIDIA_VISIBLE_DEVICES all
- NVIDIA_DRIVER_CAPABILITIES graphics,utility,compute
hostname: 4kmachine
volumes:
- ${HOME}/.Xauthority:${HOME}/.Xauthority
- /tmp/.X11-unix:/tmp/.X11-unix
- ./calvr_config:${HOME}/calvr_home
networks:
none: {}
networks:
none:
From 75546db9d139f5f6445b0ed8edcfa6c49b3bf4ec Mon Sep 17 00:00:00 2001
From: Martin Piatka <piatka@cesnet.cz>
Date: Thu, 20 May 2021 16:48:05 +0200
Subject: [PATCH 1/2] Add window number to win title
---
src/cvrKernel/ScreenConfig.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/cvrKernel/ScreenConfig.cpp b/src/cvrKernel/ScreenConfig.cpp
index 2c6c192..214ed69 100644
--- a/src/cvrKernel/ScreenConfig.cpp
+++ b/src/cvrKernel/ScreenConfig.cpp
@@ -546,7 +546,7 @@ bool ScreenConfig::makeWindows()
traits->quadBufferStereo = _windowInfoList[i]->quadBuffer;
traits->vsync = ConfigManager::getBool("SyncToVBlank",false);
traits->sharedContext = 0;
- traits->windowName = "CalVR";
+ traits->windowName = "CalVR " + std::to_string(i);
traits->displayNum = _windowInfoList[i]->myPipe->server;
traits->screenNum = _windowInfoList[i]->myPipe->screen;
traits->supportsResize = _windowInfoList[i]->supportsResize;
--
2.31.1
From d59cabd9cf7157a25b47f3136b5f37489e9fce18 Mon Sep 17 00:00:00 2001
From: Martin Piatka <piatka@cesnet.cz>
Date: Thu, 20 May 2021 16:48:32 +0200
Subject: [PATCH 2/2] mxml: use correct getters
---
include/cvrConfig/XMLReader.h | 4 +-
src/cvrConfig/XMLReader.cpp | 89 +++++++++++++++++------------------
2 files changed, 46 insertions(+), 47 deletions(-)
diff --git a/include/cvrConfig/XMLReader.h b/include/cvrConfig/XMLReader.h
index 18d8cb0..882f2a1 100644
--- a/include/cvrConfig/XMLReader.h
+++ b/include/cvrConfig/XMLReader.h
@@ -6,8 +6,8 @@
#include <cvrConfig/ConfigFileReader.h>
-struct mxml_node_s;
-typedef struct mxml_node_s mxml_node_t;
+struct _mxml_node_s;
+typedef struct _mxml_node_s mxml_node_t;
namespace cvr
{
diff --git a/src/cvrConfig/XMLReader.cpp b/src/cvrConfig/XMLReader.cpp
index b6aa615..132328b 100644
--- a/src/cvrConfig/XMLReader.cpp
+++ b/src/cvrConfig/XMLReader.cpp
@@ -66,14 +66,14 @@ bool XMLReader::loadFile(std::string file, bool givePriority)
while((xmlNode = mxmlFindElement(tree,tree,"GLOBAL",NULL,NULL,MXML_DESCEND)))
{
- if(xmlNode->parent)
+ if(mxmlGetParent(xmlNode))
{
- mxml_node_t * tempnode = xmlNode->child;
+ mxml_node_t * tempnode = mxmlGetFirstChild(xmlNode);
while(tempnode)
{
mxmlRemove(tempnode);
- mxmlAdd(xmlNode->parent,MXML_ADD_AFTER,NULL,tempnode);
- tempnode = xmlNode->child;
+ mxmlAdd(mxmlGetParent(xmlNode), MXML_ADD_AFTER,NULL,tempnode);
+ tempnode = mxmlGetFirstChild(xmlNode);
}
mxmlDelete(xmlNode);
}
@@ -87,7 +87,7 @@ bool XMLReader::loadFile(std::string file, bool givePriority)
while((xmlNode = mxmlFindElement(tree,tree,"LOCAL",NULL,NULL,MXML_DESCEND)))
{
- if(xmlNode->parent)
+ if(mxmlGetParent(xmlNode))
{
std::string blockHost;
const char * attr = mxmlElementGetAttr(xmlNode,"host");
@@ -119,12 +119,12 @@ bool XMLReader::loadFile(std::string file, bool givePriority)
if(hostfound)
{
- mxml_node_t * tempnode = xmlNode->child;
+ mxml_node_t * tempnode = mxmlGetFirstChild(xmlNode);
while(tempnode)
{
mxmlRemove(tempnode);
- mxmlAdd(xmlNode->parent,MXML_ADD_AFTER,NULL,tempnode);
- tempnode = xmlNode->child;
+ mxmlAdd(mxmlGetParent(xmlNode),MXML_ADD_AFTER,NULL,tempnode);
+ tempnode = mxmlGetFirstChild(xmlNode);
}
}
}
@@ -142,20 +142,20 @@ bool XMLReader::loadFile(std::string file, bool givePriority)
while((xmlNode = mxmlFindElement(tree,tree,"INCLUDE",NULL,NULL,MXML_DESCEND)))
{
- if(xmlNode->parent)
+ if(mxmlGetParent(xmlNode))
{
- mxml_node_t * tempnode = xmlNode->child;
+ mxml_node_t * tempnode = mxmlGetFirstChild(xmlNode);
while(tempnode)
{
- if(tempnode->type == MXML_TEXT)
+ if(mxmlGetType(tempnode) == MXML_TEXT)
{
- if(!loadFile(tempnode->value.text.string))
+ if(!loadFile(mxmlGetText(tempnode, nullptr)))
{
return false;
}
break;
}
- tempnode = tempnode->next;
+ tempnode = mxmlGetNextSibling(tempnode);
}
mxmlDelete(xmlNode);
}
@@ -190,7 +190,7 @@ std::string XMLReader::getEntry(std::string attribute, std::string path,
{
std::string pathFrag;
std::string pathRemainder = path;
- mxml_node_t * xmlNode = _configRootList[i]->child;
+ mxml_node_t * xmlNode = mxmlGetFirstChild(_configRootList[i]);
size_t location = pathRemainder.find_first_of('.');
if(location == std::string::npos)
@@ -217,7 +217,7 @@ std::string XMLReader::getEntry(std::string attribute, std::string path,
{
if(!parentStack.empty())
{
- xmlNode = parentStack.top().first->next;
+ xmlNode = mxmlGetNextSibling(parentStack.top().first);
if(!pathRemainder.empty())
{
pathRemainder = pathFrag + "." + pathRemainder;
@@ -231,12 +231,12 @@ std::string XMLReader::getEntry(std::string attribute, std::string path,
}
while(xmlNode)
{
- if(xmlNode->type != MXML_ELEMENT)
+ if(mxmlGetType(xmlNode) != MXML_ELEMENT)
{
- xmlNode = xmlNode->next;
+ xmlNode = mxmlGetNextSibling(xmlNode);
continue;
}
- std::string nodeName = xmlNode->value.element.name;
+ std::string nodeName = mxmlGetElement(xmlNode);
const char * nameAtt = mxmlElementGetAttr(xmlNode,"name");
std::string suffix = nameAtt ? nameAtt : "";
@@ -265,7 +265,7 @@ std::string XMLReader::getEntry(std::string attribute, std::string path,
}
else
{
- xmlNode = xmlNode->next;
+ xmlNode = mxmlGetNextSibling(xmlNode);
}
}
else
@@ -292,12 +292,12 @@ std::string XMLReader::getEntry(std::string attribute, std::string path,
pathRemainder = "";
}
}
- xmlNode = xmlNode->child;
+ xmlNode = mxmlGetFirstChild(xmlNode);
}
}
else
{
- xmlNode = xmlNode->next;
+ xmlNode = mxmlGetNextSibling(xmlNode);
}
}
}
@@ -334,7 +334,7 @@ std::string XMLReader::getEntryConcat(std::string attribute, std::string path,
{
std::string pathFrag;
std::string pathRemainder = path;
- mxml_node_t * xmlNode = _configRootList[i]->child;
+ mxml_node_t * xmlNode = mxmlGetFirstChild(_configRootList[i]);
size_t location = pathRemainder.find_first_of('.');
if(location == std::string::npos)
@@ -361,7 +361,7 @@ std::string XMLReader::getEntryConcat(std::string attribute, std::string path,
{
if(!parentStack.empty())
{
- xmlNode = parentStack.top().first->next;
+ xmlNode = mxmlGetNextSibling(parentStack.top().first);
if(!pathRemainder.empty())
{
pathRemainder = pathFrag + "." + pathRemainder;
@@ -375,12 +375,12 @@ std::string XMLReader::getEntryConcat(std::string attribute, std::string path,
}
while(xmlNode)
{
- if(xmlNode->type != MXML_ELEMENT)
+ if(mxmlGetType(xmlNode) != MXML_ELEMENT)
{
- xmlNode = xmlNode->next;
+ xmlNode = mxmlGetNextSibling(xmlNode);
continue;
}
- std::string nodeName = xmlNode->value.element.name;
+ std::string nodeName = mxmlGetElement(xmlNode);
const char * nameAtt = mxmlElementGetAttr(xmlNode,"name");
std::string suffix = nameAtt ? nameAtt : "";
@@ -405,7 +405,7 @@ std::string XMLReader::getEntryConcat(std::string attribute, std::string path,
result = result + separator + attr;
}
}
- xmlNode = xmlNode->next;
+ xmlNode = mxmlGetNextSibling(xmlNode);
}
else
{
@@ -431,12 +431,12 @@ std::string XMLReader::getEntryConcat(std::string attribute, std::string path,
pathRemainder = "";
}
}
- xmlNode = xmlNode->child;
+ xmlNode = mxmlGetFirstChild(xmlNode);
}
}
else
{
- xmlNode = xmlNode->next;
+ xmlNode = mxmlGetNextSibling(xmlNode);
}
}
}
@@ -753,7 +753,7 @@ void XMLReader::getChildren(std::string path,
{
std::string pathFrag;
std::string pathRemainder = path;
- mxml_node_t * xmlNode = _configRootList[i]->child;
+ mxml_node_t * xmlNode = mxmlGetFirstChild(_configRootList[i]);
size_t location = pathRemainder.find_first_of('.');
if(location == std::string::npos)
@@ -780,7 +780,7 @@ void XMLReader::getChildren(std::string path,
{
if(!parentStack.empty())
{
- xmlNode = parentStack.top().first->next;
+ xmlNode = mxmlGetNextSibling(parentStack.top().first);
if(!pathRemainder.empty())
{
pathRemainder = pathFrag + "." + pathRemainder;
@@ -794,12 +794,12 @@ void XMLReader::getChildren(std::string path,
}
while(xmlNode)
{
- if(xmlNode->type != MXML_ELEMENT)
+ if(mxmlGetType(xmlNode) != MXML_ELEMENT)
{
- xmlNode = xmlNode->next;
+ xmlNode = mxmlGetNextSibling(xmlNode);
continue;
}
- std::string nodeName = xmlNode->value.element.name;
+ std::string nodeName = mxmlGetElement(xmlNode);
const char * nameAtt = mxmlElementGetAttr(xmlNode,"name");
std::string suffix = nameAtt ? nameAtt : "";
@@ -813,26 +813,25 @@ void XMLReader::getChildren(std::string path,
//std::cerr << "Found Fragment." << std::endl;
if(pathRemainder.empty())
{
- if(xmlNode->child)
+ if(mxmlGetFirstChild(xmlNode))
{
- mxml_node_t * cnode = xmlNode->child;
+ mxml_node_t * cnode = mxmlGetFirstChild(xmlNode);
while(cnode)
{
- if(cnode->type != MXML_ELEMENT)
+ if(mxmlGetType(cnode) != MXML_ELEMENT)
{
- cnode = cnode->next;
+ cnode = mxmlGetNextSibling(cnode);
continue;
}
// ignore comment tags
- if(strncmp(cnode->value.element.name,"!--",3))
+ if(strncmp(mxmlGetElement(cnode), "!--",3))
{
- destList.push_back(
- cnode->value.element.name);
+ destList.push_back(mxmlGetElement(cnode));
}
- cnode = cnode->next;
+ cnode = mxmlGetNextSibling(cnode);
}
}
- xmlNode = xmlNode->next;
+ xmlNode = mxmlGetNextSibling(xmlNode);
}
else
{
@@ -860,12 +859,12 @@ void XMLReader::getChildren(std::string path,
}
//std::cerr << "Looking for fragment: " << pathFrag << std::endl;
//std::cerr << "with remainder: " << pathRemainder << std::endl;
- xmlNode = xmlNode->child;
+ xmlNode = mxmlGetFirstChild(xmlNode);
}
}
else
{
- xmlNode = xmlNode->next;
+ xmlNode = mxmlGetNextSibling(xmlNode);
}
}
}
--
2.31.1
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment