Skip to content
This repository has been archived by the owner on Feb 21, 2021. It is now read-only.

Commit

Permalink
Merge pull request #304 from fqez/resourcelocator
Browse files Browse the repository at this point in the history
solve glade problem #263 with resourcelocator
  • Loading branch information
fqez committed Feb 3, 2016
2 parents e18984d + e6b99dd commit 23e738d
Show file tree
Hide file tree
Showing 25 changed files with 350 additions and 21 deletions.
6 changes: 6 additions & 0 deletions src/stable/components/cameraview/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ include_directories(
${libglademm_INCLUDE_DIRS}
${gtkglextmm_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIRS}
${resourcelocator_INCLUDE_DIRS}
)
link_directories(
${resourcelocator_LIBRARY_DIRS}
)


add_executable (cameraview ${SOURCE_FILES})

Expand All @@ -30,4 +35,5 @@ TARGET_LINK_LIBRARIES(cameraview
${ZeroCIce_LIBRARIES}
${ZLIB_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${resourcelocator_LIBRARIES}
)
3 changes: 2 additions & 1 deletion src/stable/components/cameraview/viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@
#include <iostream>
#include <cmath>
#include <string>
#include <resourcelocator/gladelocator.hpp>

namespace cameraview {
const std::string gladepath = std::string(GLADE_DIR) + std::string("/cameraview.glade");
const std::string gladepath = resourcelocator::findGladeFile("cameraview.glade");

Viewer::Viewer()
: gtkmain(0, 0), frameCount(0) {
Expand Down
6 changes: 5 additions & 1 deletion src/stable/components/giraffeClient/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${gtkmm_INCLUDE_DIRS}
${libglademm_INCLUDE_DIRS}
${resourcelocator_INCLUDE_DIRS}
)

link_directories(
${resourcelocator_LIBRARY_DIRS}
)


add_executable (giraffeClient ${SOURCE_FILES})
Expand All @@ -26,5 +30,5 @@ TARGET_LINK_LIBRARIES(giraffeClient
jderobotutil
progeo
${ZeroCIce_LIBRARIES}
${resourcelocator_LIBRARIES}
)

3 changes: 2 additions & 1 deletion src/stable/components/giraffeClient/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@
*/

#include "controller.h"
#include <resourcelocator/gladelocator.hpp>

namespace giraffeClient {

Controller::Controller(RoboCompJointMotor::JointMotorPrx jprx) {
this->gladepath = std::string(GLADE_DIR) + std::string("/giraffeClient.glade");
this->gladepath = resourcelocator::findGladeFile("giraffeClient.glade");
this->jprx = jprx;
this->camera = new CameraConf(this->jprx);
}
Expand Down
7 changes: 6 additions & 1 deletion src/stable/components/introrob/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,21 @@ include_directories(
${gtkglextmm_INCLUDE_DIRS}
${libgnomecanvas_INCLUDE_DIRS}
${libgnomecanvasmm_INCLUDE_DIRS}
${resourcelocator_INCLUDE_DIRS}
)

set( CMAKE_CXX_FLAGS "-Wno-deprecated") # Opciones para el compilador

INSTALL (FILES ${CMAKE_CURRENT_SOURCE_DIR}/myimage.png DESTINATION /usr/local/share/jderobot/conf/ COMPONENT core)
INSTALL (FILES ${CMAKE_CURRENT_SOURCE_DIR}/myimage.png DESTINATION /usr/local/share/jderobot/glade/ COMPONENT core)

FILE(GLOB XML_FILES ${CMAKE_CURRENT_SOURCE_DIR}/cameras/*xml)
FOREACH (xml ${XML_FILES})
INSTALL (FILES ${xml} DESTINATION /usr/local/share/jderobot/conf/cameras/ COMPONENT core)
ENDFOREACH(xml)

link_directories(
${resourcelocator_LIBRARY_DIRS}
)

add_executable (introrob ${SOURCE_FILES})
TARGET_LINK_LIBRARIES(introrob
Expand All @@ -48,4 +52,5 @@ TARGET_LINK_LIBRARIES(introrob
# ${gsl_LIBRARIES}
${ZeroCIce_LIBRARIES}
${Gearbox_LIBRARIES}
${resourcelocator_LIBRARIES}
)
7 changes: 4 additions & 3 deletions src/stable/components/introrob/gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
*/

#include "gui.h"
#include <resourcelocator/gladelocator.hpp>

namespace introrob {

Expand Down Expand Up @@ -50,8 +51,8 @@ namespace introrob {
}
Gnome::Canvas::init();
std::cout << "Loading glade\n";
refXml = Gnome::Glade::Xml::create("./introrob.glade");
this->gladepath = std::string("./introrob.glade");
this->gladepath = resourcelocator::findGladeFile("introrob.glade");
refXml = Gnome::Glade::Xml::create(gladepath);

// GET WIDGETS & WINDOWS

Expand Down Expand Up @@ -149,7 +150,7 @@ namespace introrob {
windowLaser->hide();
secondarywindow->hide();

m_image = Gdk::Pixbuf::create_from_file("myimage.png");
m_image = Gdk::Pixbuf::create_from_file(resourcelocator::findGladeFile("myimage.png"));
}

Gui::~Gui() {
Expand Down
6 changes: 6 additions & 0 deletions src/stable/components/navigatorCamera/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ include_directories(
${libglademm_INCLUDE_DIRS}
${gtkglextmm_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIRS}
${resourcelocator_INCLUDE_DIRS}
)
link_directories(
${resourcelocator_LIBRARY_DIRS}
)


add_executable (navigatorCamera ${SOURCE_FILES})

Expand All @@ -31,4 +36,5 @@ TARGET_LINK_LIBRARIES(navigatorCamera
parallelIce
${ZeroCIce_LIBRARIES}
${ZLIB_LIBRARIES}
${resourcelocator_LIBRARIES}
)
3 changes: 2 additions & 1 deletion src/stable/components/navigatorCamera/gui.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "gui.h"
#include <resourcelocator/gladelocator.hpp>

namespace navigatorCamera {

Expand All @@ -9,7 +10,7 @@ namespace navigatorCamera {

std::cout << "Loading glade." << std::endl;

const std::string gladepath = std::string(GLADE_DIR) + gladeFile;
const std::string gladepath = resourcelocator::findGladeFile(gladeFile);
refXml = Gnome::Glade::Xml::create(gladepath);

refXml->get_widget("showWindow", showWindow);
Expand Down
2 changes: 1 addition & 1 deletion src/stable/components/navigatorCamera/navigatorCamera.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ navigatorCamera.CameraRGB.Format=RGB8
navigatorCamera.CameraRGB.Fps=10

# Pose3D interface
navigatorCamera.Pose3D.Proxy=Pose3d:default -h localhost -p 9987
navigatorCamera.Pose3D.Proxy=Pose3d:default -h localhost -p 9997
navigatorCamera.Pose3D.Fps=10

# GUI activation flag
Expand Down
7 changes: 5 additions & 2 deletions src/stable/components/opencvdemo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${gtkmm_INCLUDE_DIRS}
${libglademm_INCLUDE_DIRS}
${resourcelocator_INCLUDE_DIRS}
)

link_directories(
${resourcelocator_LIBRARY_DIRS}
)

add_executable (opencvdemo ${SOURCE_FILES})

Expand All @@ -24,6 +28,5 @@ TARGET_LINK_LIBRARIES(opencvdemo
jderobotutil
# ${Gearbox_LIBRARIES}
${ZeroCIce_LIBRARIES}


${resourcelocator_LIBRARIES}
)
3 changes: 2 additions & 1 deletion src/stable/components/opencvdemo/viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,15 @@
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/video/tracking.hpp>
/*#include <highgui.h>*/
#include <resourcelocator/gladelocator.hpp>

using namespace cv;

#define SQUARE(a) (a)*(a)
#define PI 3.141592654
namespace opencvdemo{

const std::string gladepath = std::string("./opencvdemo.glade");
const std::string gladepath = resourcelocator::findGladeFile("opencvdemo.glade");

int opflow_first=1;
Mat previous;
Expand Down
5 changes: 5 additions & 0 deletions src/stable/components/replayController/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ include_directories(
${gtkmm_INCLUDE_DIRS}
${libglademm_INCLUDE_DIRS}
${gtkglextmm_INCLUDE_DIRS}
${resourcelocator_INCLUDE_DIRS}
)

link_directories(
${resourcelocator_LIBRARY_DIRS}
)
add_executable (replayController ${SOURCE_FILES})


Expand All @@ -35,4 +39,5 @@ TARGET_LINK_LIBRARIES(replayController
jderobotHandlers
${ZeroCIce_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${resourcelocator_LIBRARIES}
)
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include <jderobotHandlers/ReplayControlerClientHDL.h>
#include "replayControllerGui.h"
#include <resourcelocator/gladelocator.hpp>


namespace replayController {
Expand All @@ -17,7 +18,8 @@ replayControllergui::replayControllergui(jderobot::ReplayControlerClientHDLPtr&
this->controller=c;
this->exit=false;
std::cout << "Loading glade\n";
refXml = Gnome::Glade::Xml::create("./replayControllerGui.glade");
const std::string gladepath = resourcelocator::findGladeFile("replayControllerGui.glade");
refXml = Gnome::Glade::Xml::create(gladepath);

/*Get widgets*/
refXml->get_widget("window1",mainwindow);
Expand Down
6 changes: 6 additions & 0 deletions src/stable/components/rgbdCalibrator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${gtkmm_INCLUDE_DIRS}
${libglademm_INCLUDE_DIRS}
${resourcelocator_INCLUDE_DIRS}
)

link_directories(
${resourcelocator_LIBRARY_DIRS}
)

add_executable (rgbdCalibrator ${SOURCE_FILES})
Expand All @@ -28,5 +33,6 @@ TARGET_LINK_LIBRARIES(rgbdCalibrator
geometry
colorspaces
cvblob
${resourcelocator_LIBRARIES}

)
5 changes: 2 additions & 3 deletions src/stable/components/rgbdCalibrator/viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <IceUtil/IceUtil.h>
#include <boost/filesystem.hpp>
#include <visionlib/cvBlob/cvblob.h>
#include <resourcelocator/gladelocator.hpp>

#define DEGTORAD (3.14159264 / 180.0)
#define DEBUG TRUE
Expand All @@ -34,9 +35,7 @@ using namespace cvb;

namespace rgbdCalibrator{


const std::string gladepath = std::string(GLADE_DIR) +
std::string("/rgbdCalibrator.glade");
const std::string gladepath = resourcelocator::findGladeFile("rgbdCalibrator.glade");

const std::string pathImage = "./images/";

Expand Down
7 changes: 6 additions & 1 deletion src/stable/components/rgbdManualCalibrator/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
SET( SOURCE_FILES common.h controller.cpp drawarea.cpp view.h rgbdManualCalibrator.cpp controller.h drawarea.h view.cpp)
add_definitions(-DGLADE_DIR="${gladedir}")

include_directories(
${INTERFACES_CPP_DIR}
Expand All @@ -11,8 +10,13 @@ include_directories(
${gtkmm_INCLUDE_DIRS}
${libglademm_INCLUDE_DIRS}
${gtkglextmm_INCLUDE_DIRS}
${resourcelocator_INCLUDE_DIRS}
)

link_directories(
${resourcelocator_LIBRARY_DIRS}
)

add_executable (rgbdManualCalibrator ${SOURCE_FILES})

TARGET_LINK_LIBRARIES( rgbdManualCalibrator
Expand All @@ -35,4 +39,5 @@ TARGET_LINK_LIBRARIES( rgbdManualCalibrator
progeo
parallelIce
${ZLIB_LIBRARIES}
${resourcelocator_LIBRARIES}
)
3 changes: 2 additions & 1 deletion src/stable/components/rgbdManualCalibrator/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@

#include <opencv2/imgproc/imgproc.hpp>
#include "controller.h"
#include <resourcelocator/gladelocator.hpp>

namespace rgbdManualCalibrator {

Controller::Controller(Ice::PropertiesPtr prop, int w, int h, int nCameras) {
cameras.resize(nCameras);
this->gladepath = std::string("./rgbdManualCalibrator.glade");
this->gladepath = resourcelocator::findGladeFile("rgbdManualCalibrator.glade");

this->world = prop->getProperty("rgbdManualCalibrator.World.File");
//cout << "world es " << this->world << endl;
Expand Down
8 changes: 6 additions & 2 deletions src/stable/components/rgbdViewer/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
SET(SOURCE_FILES rgbdViewer.cpp drawarea.cpp rgbdViewergui.cpp myprogeo.cpp)

add_definitions(-DGLADE_DIR="${gladedir}")

set( CMAKE_CXX_FLAGS "-Wno-deprecated" ) # Opciones para el compilador-lgsl -lgslcblas -lGL -lGLU -lglut -lgazebo

include_directories(
Expand All @@ -12,6 +10,11 @@ include_directories(
${gtkmm_INCLUDE_DIRS}
${libglademm_INCLUDE_DIRS}
${gtkglextmm_INCLUDE_DIRS}
${resourcelocator_INCLUDE_DIRS}
)

link_directories(
${resourcelocator_LIBRARY_DIRS}
)

add_executable (rgbdViewer ${SOURCE_FILES})
Expand All @@ -35,4 +38,5 @@ TARGET_LINK_LIBRARIES(rgbdViewer
${gsl_LIBRARIES}
${ZeroCIce_LIBRARIES}
${ZLIB_LIBRARIES}
${resourcelocator_LIBRARIES}
)
4 changes: 3 additions & 1 deletion src/stable/components/rgbdViewer/rgbdViewergui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <string>
#include <iostream>
#include <opencv2/imgproc/imgproc.hpp>
#include <resourcelocator/gladelocator.hpp>

namespace rgbdViewer {
rgbdViewergui::rgbdViewergui(bool rgb, bool depth,bool pointCloud , std::string path, std::string path_rgb, std::string path_ir, cv::Size sizeRGB, cv::Size sizeDEPTH, float cycle): gtkmain(0,0) {
Expand Down Expand Up @@ -70,7 +71,8 @@ rgbdViewergui::rgbdViewergui(bool rgb, bool depth,bool pointCloud , std::string
lines_depth_active=false;
lines_rgb_active=false;
std::cout << "Loading glade\n";
refXml = Gnome::Glade::Xml::create("./rgbdViewergui.glade");
const std::string gladepath = resourcelocator::findGladeFile("rgbdViewergui.glade");
refXml = Gnome::Glade::Xml::create(gladepath);
myDepthSize=sizeDEPTH;
myRGBSize=sizeRGB;

Expand Down
Loading

0 comments on commit 23e738d

Please sign in to comment.