Skip to content
This repository has been archived by the owner on Dec 12, 2019. It is now read-only.

Commit

Permalink
Merge pull request #129 from Astroua/develop
Browse files Browse the repository at this point in the history
Merge Develop into Master for release 0.5.0
  • Loading branch information
alexstrilets committed Jan 21, 2016
2 parents fe205ed + 0df2967 commit 244f19d
Show file tree
Hide file tree
Showing 292 changed files with 14,419 additions and 4,702 deletions.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,3 @@ Issues:
https://github.com/pfederl/CARTAvis/issues


There are two scripts createlinksMac.sh and createlinks.sh that are used to create symbolic link in
ThirdParty directory to various libraries and headers that CARTA needs.
Those links can be created manually but it is easier to do it with the script. Just edit script to point to the
lib and include directories and run it. It will create symbolic links in the ThirdParty directory.
2 changes: 2 additions & 0 deletions carta/.qmake.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
top_srcdir=$$PWD
top_builddir=$$shadowed($$PWD)
19 changes: 8 additions & 11 deletions carta/carta.pro
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,6 @@ CONFIG(release,debug|release) {
error("Cannot include cpp/common.pri file")
}
#isEmpty( CARTA_BUILD_TYPE) {
# warning( "You did not specify CARTA_BUILD_TYPE to qmake...")
# warning( "supported builds are: release dev bughunter")
# warning( "please rerun qmake with an argument 'CARTA_BUILD_TYPE=dev'")
#}
#dbg( "root PWD=$$PWD")
#dbg( "root IN_PWD=$$IN_PWD")
#dbg( "root _PRO_FILE_PWD_=$$_PRO_FILE_PWD_")
#dbg( "root OUT_PWD=$$OUT_PWD")
dbg( "===----------Adjusted compiler settings---------====")
dbg( "QMAKE_CXX $$QMAKE_CXX")
dbg( "QMAKE_CXXFLAGS_DEBUG $$QMAKE_CXXFLAGS_DEBUG")
Expand All @@ -60,5 +49,13 @@ dbg( "===---------------------------------------------====")
# dbg( "$${var} = $${x}")
#}
#mytarget.target = buildfile.txt
#mytarget.commands = touch $$mytarget.target
#mytarget.depends = mytarget2 mytarget3
#mytarget2.commands = @echo Building $$mytarget.target
#mytarget3.commands = @echo top src/build: $$top_srcdir $$top_builddir
#QMAKE_EXTRA_TARGETS += mytarget mytarget2 mytarget3
4 changes: 2 additions & 2 deletions carta/cpp/CartaLib/Algorithms/ContourConrec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ typedef std::vector < double > VD;
*/
static Carta::Lib::Algorithms::ContourConrec::Result
conrecFaster(
NdArray::RawViewInterface * view,
Carta::Lib::NdArray::RawViewInterface * view,
int ilb,
int iub,
int jlb,
Expand Down Expand Up @@ -66,7 +66,7 @@ conrecFaster(
nextRowToReadIn++;

// make a double view of this raw row view
NdArray::Double dview( rawRowView, true );
Carta::Lib::NdArray::Double dview( rawRowView, true );

// shift the row up
// note: we could avoid this memory copy if we swapped row[] pointers instead,
Expand Down
2 changes: 1 addition & 1 deletion carta/cpp/CartaLib/Algorithms/LineCombiner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ LineCombiner::add( QPointF p1, QPointF p2 )
CARTA_ASSERT( ok );
ok = findCell( ip2c.poly->back() )-> pts.removeAll( { ip2c.poly, true }
);
CARTA_ASSERT( ok );
CARTA_ASSERT( ok ); Q_UNUSED(ok);

// we need to handle 4 cases for merging... in any case, we'll be re-using poly1 and
// appending/prepending to it all elements from poly2
Expand Down
1 change: 1 addition & 0 deletions carta/cpp/CartaLib/AxisInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class AxisInfo
STOKES, /// < stokes axis
TABULAR, /// < not sure but casacore uses it, maybe it's important?
QUALITY, /// < not sure but casacore uses it, maybe it's important?
LINEAR,
OTHER
};

Expand Down
6 changes: 1 addition & 5 deletions carta/cpp/CartaLib/CartaLib.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
#include <iostream>
#include <memory>

#ifndef CARTA_RUNTIME_CHECKS
#define CARTA_RUNTIME_CHECKS 0
#endif

/// all carta code lives here (or will eventually)
namespace Carta
{
Expand Down Expand Up @@ -128,7 +124,7 @@ clamp( const T & v, const T & v1, const T & v2 )

/// assert macro that is compiled out in release, with additional message
/// \note the CARTA_RUNTIME_CHECKS is defined in common.pri, depending on the type of build
#ifdef CARTA_RUNTIME_CHECKS
#if CARTA_RUNTIME_CHECKS > 0
#define CARTA_ASSERT_X( cond, msg ) CARTA_ASSERT_ALWAYS_X( cond, msg )
#else
#define CARTA_ASSERT_X( cond, msg ) qt_noop();
Expand Down
11 changes: 9 additions & 2 deletions carta/cpp/CartaLib/CartaLib.pro
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ SOURCES += \
Algorithms/ContourConrec.cpp \
IWcsGridRenderService.cpp \
ContourSet.cpp \
Algorithms/LineCombiner.cpp
Algorithms/LineCombiner.cpp \
IImageRenderService.cpp \
IRemoteVGView.cpp

HEADERS += \
CartaLib.h\
Expand Down Expand Up @@ -66,7 +68,12 @@ HEADERS += \
IWcsGridRenderService.h \
IContourGeneratorService.h \
ContourSet.h \
Algorithms/LineCombiner.h
Algorithms/LineCombiner.h \
Hooks/GetInitialFileList.h \
Hooks/Initialize.h \
IImageRenderService.h \
Hooks/GetImageRenderService.h \
IRemoteVGView.h

unix {
target.path = /usr/lib
Expand Down
6 changes: 3 additions & 3 deletions carta/cpp/CartaLib/Hooks/ColormapsScalar.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace Hooks
{
class ColormapsScalarHook : public BaseHook
{
CARTA_HOOK_BOILER1( ColormapsScalarHook )
CARTA_HOOK_BOILER1( ColormapsScalarHook );

public:

Expand All @@ -33,8 +33,8 @@ class ColormapsScalarHook : public BaseHook
struct Params { };

/**
* @brief PreRender
* @param pptr
* @brief constructor
* @param pptr pointer to the input parameters
*
* @todo make hook constructors protected, so that only hook helper can create them
*/
Expand Down
49 changes: 49 additions & 0 deletions carta/cpp/CartaLib/Hooks/GetImageRenderService.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/**
* Hook for adding new image render service.
*
**/

#pragma once

#include "CartaLib/CartaLib.h"
#include "CartaLib/IPlugin.h"
#include "CartaLib/IImageRenderService.h"
#include <vector>

namespace Carta
{
namespace Lib
{
namespace Hooks
{
class GetImageRenderService : public BaseHook
{
CARTA_HOOK_BOILER1( GetImageRenderService );

public:

/**
* @brief Result is a render service.
*/
typedef IImageRenderService::SharedPtr ResultType;

/**
* @brief No input
*/
struct Params { };

/**
* @brief constructor
* @param pptr pointer to the input parameters
*/
GetImageRenderService( Params * pptr ) : BaseHook( staticId ), paramsPtr( pptr )
{
CARTA_ASSERT( is < Me > () );
}

ResultType result;
Params * paramsPtr;
};
}
}
}
52 changes: 52 additions & 0 deletions carta/cpp/CartaLib/Hooks/GetInitialFileList.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/**
* Defines a hook for obtaining an initial file list.
*
**/

#pragma once

#include "CartaLib/CartaLib.h"
#include "CartaLib/IPlugin.h"
#include <vector>

namespace Carta
{
namespace Lib
{
namespace Hooks
{
/// \brief Hook for loading a plugin of an unknown type
///
class GetInitialFileList : public BaseHook
{
CARTA_HOOK_BOILER1( GetInitialFileList );

public:

/// result of the hook is a list of filenames
typedef QStringList ResultType;

/// input parameters are:
/// map of all url parameters
struct Params {
Params( const std::map< QString, QString> & p_urlParams )
{
urlParams = p_urlParams;
}

std::map< QString, QString> urlParams;
};

/// standard constructor (could be probably a macro)
GetInitialFileList( Params * pptr ) : BaseHook( staticId ), paramsPtr( pptr )
{
// force instantiation of templates
CARTA_ASSERT( is < Me > () );
}

ResultType result;
Params * paramsPtr = nullptr;
};
}
}
}
2 changes: 1 addition & 1 deletion carta/cpp/CartaLib/Hooks/GetWcsGridRenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace Hooks
class GetWcsGridRendererHook : public BaseHook
{
// all hooks should have this:
CARTA_HOOK_BOILER1( GetWcsGridRendererHook )
CARTA_HOOK_BOILER1( GetWcsGridRendererHook );

public:

Expand Down
8 changes: 4 additions & 4 deletions carta/cpp/CartaLib/Hooks/Histogram.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@
#include <vector>
#include "CartaLib/Hooks/HistogramResult.h"

namespace Image {
class ImageInterface;
}
namespace Carta
{
namespace Lib
{
namespace Image {
class ImageInterface;
}
namespace Hooks
{
class HistogramHook : public BaseHook
{
CARTA_HOOK_BOILER1( HistogramHook )
CARTA_HOOK_BOILER1( HistogramHook );

public:

Expand Down
2 changes: 2 additions & 0 deletions carta/cpp/CartaLib/Hooks/HookIDs.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ enum class UniqueHookIDs {
ColormapsScalarHook_ID,
LoadPlugin_ID,
GetWcsGridRendererHook_ID,
GetInitialFileList_ID,
GetImageRenderService_ID,

/// experimental, soon to be removed:
PreRender_ID,
Expand Down
41 changes: 41 additions & 0 deletions carta/cpp/CartaLib/Hooks/Initialize.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/**
* Defines a hook that is executed once, when core is starting up.
*
**/

#pragma once

#include "CartaLib/CartaLib.h"
#include "CartaLib/IPlugin.h"
#include <vector>

namespace Carta
{
namespace Lib
{
namespace Hooks
{
/// \brief Hook for loading a plugin of an unknown type
///
class Initialize : public BaseHook
{
CARTA_HOOK_BOILER1( Initialize );

public:

typedef FakeVoid ResultType;
typedef struct { } Params;

/// standard constructor (could be probably a macro)
Initialize( Params * pptr ) : BaseHook( staticId ), paramsPtr( pptr )
{
// force instantiation of templates
CARTA_ASSERT( is < Me > () );
}

ResultType result;
Params * paramsPtr = nullptr;
};
}
}
}
2 changes: 1 addition & 1 deletion carta/cpp/CartaLib/Hooks/LoadAstroImage.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace Hooks
/// load an (astronomical) image and convert to an instance of Image::ImageInterface
class LoadAstroImage : public BaseHook
{
CARTA_HOOK_BOILER1( LoadAstroImage )
CARTA_HOOK_BOILER1( LoadAstroImage );

public:

Expand Down
6 changes: 6 additions & 0 deletions carta/cpp/CartaLib/IImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

#include "IImage.h"

namespace Carta {
namespace Lib {

const Unit &Image::ImageInterface::getPixelUnit() const
{
qFatal( "Calling unimplemented virtual function... ");
Expand Down Expand Up @@ -65,3 +68,6 @@ Image::MetaDataInterface::~MetaDataInterface()
{

}

}
}
Loading

0 comments on commit 244f19d

Please sign in to comment.