Skip to content
Snippets Groups Projects
Commit d53bdca2 authored by juergen's avatar juergen
Browse files

-added drives to windows file explorer

-fixed some dllexports


git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@1899 5a81b35b-ba03-0410-adc8-b2c5c5119f08
parent 5dab94a4
No related branches found
No related tags found
No related merge requests found
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
*/ */
#include "vec3.hh" #include "vec3.hh"
#include "module_config.hh"
namespace geom { namespace geom {
...@@ -31,7 +32,7 @@ namespace geom { ...@@ -31,7 +32,7 @@ namespace geom {
/// \brief axis-aligned cuboid /// \brief axis-aligned cuboid
/// ///
/// For an arbitrarily oriented cuboid see \ref Cuboid /// For an arbitrarily oriented cuboid see \ref Cuboid
class DLLEXPORT AlignedCuboid { class DLLEXPORT_OST_GEOM AlignedCuboid {
public: public:
AlignedCuboid(const Vec3& mmin, const Vec3& mmax); AlignedCuboid(const Vec3& mmin, const Vec3& mmax);
...@@ -47,7 +48,7 @@ private: ...@@ -47,7 +48,7 @@ private:
Vec3 max_; Vec3 max_;
}; };
AlignedCuboid DLLEXPORT Union(const AlignedCuboid& lhs, const AlignedCuboid& rhs); AlignedCuboid DLLEXPORT_OST_GEOM Union(const AlignedCuboid& lhs, const AlignedCuboid& rhs);
} }
... ...
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
namespace geom { namespace geom {
//! Line2 //! Line2
class DLLEXPORT Line2 { class DLLEXPORT_OST_GEOM Line2 {
public: public:
Line2(); Line2();
Line2(const Vec2& from, const Vec2& to); Line2(const Vec2& from, const Vec2& to);
...@@ -42,7 +42,7 @@ private: ...@@ -42,7 +42,7 @@ private:
Vec2 ori_,dir_; Vec2 ori_,dir_;
}; };
class DLLEXPORT Rectangle2{ class DLLEXPORT_OST_GEOM Rectangle2{
public: public:
Rectangle2(); Rectangle2();
Rectangle2(Vec2 topleft, Vec2 bottomright); Rectangle2(Vec2 topleft, Vec2 bottomright);
...@@ -62,7 +62,7 @@ private: ...@@ -62,7 +62,7 @@ private:
//! Polygon2 //! Polygon2
///\sa \ref create_split_image.py "Create Split Image Example" ///\sa \ref create_split_image.py "Create Split Image Example"
class DLLEXPORT Polygon2: public std::vector<Vec2> class DLLEXPORT_OST_GEOM Polygon2: public std::vector<Vec2>
{ {
public: public:
typedef const_circular_iter<Polygon2> const_circular_iterator; typedef const_circular_iter<Polygon2> const_circular_iterator;
...@@ -92,7 +92,7 @@ private: ...@@ -92,7 +92,7 @@ private:
; ;
}; };
class DLLEXPORT Ellipse2 class DLLEXPORT_OST_GEOM Ellipse2
{ {
public: public:
Ellipse2(); Ellipse2();
...@@ -117,7 +117,7 @@ private: ...@@ -117,7 +117,7 @@ private:
Real gamma_; Real gamma_;
}; };
class DLLEXPORT Hyperbola2 class DLLEXPORT_OST_GEOM Hyperbola2
{ {
public: public:
Hyperbola2(); Hyperbola2();
...@@ -138,7 +138,7 @@ private: ...@@ -138,7 +138,7 @@ private:
Real gamma_; Real gamma_;
}; };
class DLLEXPORT Circle2 class DLLEXPORT_OST_GEOM Circle2
{ {
public: public:
Circle2(); Circle2();
... ...
......
...@@ -38,10 +38,10 @@ bool DLLEXPORT_OST_GEOM EqualPosition(const Line2& l1, const Line2& l2,Real ephi ...@@ -38,10 +38,10 @@ bool DLLEXPORT_OST_GEOM EqualPosition(const Line2& l1, const Line2& l2,Real ephi
bool DLLEXPORT_OST_GEOM AreParallel(const Line2& l1, const Line2& l2,Real ephilon=EPSILON); bool DLLEXPORT_OST_GEOM AreParallel(const Line2& l1, const Line2& l2,Real ephilon=EPSILON);
DLLEXPORT bool IsInPolygon(const Polygon2& p, const Vec2& v); DLLEXPORT_OST_GEOM bool IsInPolygon(const Polygon2& p, const Vec2& v);
DLLEXPORT Polygon2 SimplifyPolygon(const Polygon2& p); DLLEXPORT_OST_GEOM Polygon2 SimplifyPolygon(const Polygon2& p);
DLLEXPORT bool IsInRectangle(const Rectangle2& r, const Vec2& v); DLLEXPORT_OST_GEOM bool IsInRectangle(const Rectangle2& r, const Vec2& v);
DLLEXPORT bool IsInCircle(const Circle2& c, const Vec2& v); DLLEXPORT_OST_GEOM bool IsInCircle(const Circle2& c, const Vec2& v);
} // ns } // ns
... ...
......
...@@ -33,19 +33,19 @@ namespace geom { ...@@ -33,19 +33,19 @@ namespace geom {
code may choose to catch exceptions from code may choose to catch exceptions from
the geom library undifferentiatedly the geom library undifferentiatedly
*/ */
class DLLEXPORT GeomException: public std::runtime_error { class DLLEXPORT_OST_GEOM GeomException: public std::runtime_error {
public: public:
GeomException(const String& m): GeomException(const String& m):
std::runtime_error(m) {} std::runtime_error(m) {}
}; };
class DLLEXPORT DivideByZeroException: public GeomException { class DLLEXPORT_OST_GEOM DivideByZeroException: public GeomException {
public: public:
DivideByZeroException(const String& m="Divide By Zero"): DivideByZeroException(const String& m="Divide By Zero"):
GeomException(m) {} GeomException(m) {}
}; };
class DLLEXPORT OutOfRangeException: public GeomException { class DLLEXPORT_OST_GEOM OutOfRangeException: public GeomException {
public: public:
OutOfRangeException(const String& m="Out Of Range"): OutOfRangeException(const String& m="Out Of Range"):
GeomException(m) {} GeomException(m) {}
... ...
......
...@@ -21,10 +21,11 @@ ...@@ -21,10 +21,11 @@
#include <string> #include <string>
#include <ost/message.hh> #include <ost/message.hh>
#include "module_config.hh"
namespace geom { namespace geom {
class DLLEXPORT GeomException: public Error class DLLEXPORT_OST_GEOM GeomException: public Error
{ {
public: public:
GeomException(const String& m): GeomException(const String& m):
... ...
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include <boost/operators.hpp> #include <boost/operators.hpp>
#include <ost/dllexport.hh> #include <ost/module_config.hh>
#include <ost/config.hh> #include <ost/config.hh>
namespace geom { namespace geom {
... ...
......
...@@ -158,8 +158,21 @@ void FileBrowser::UpdateMenu(const QString path){ ...@@ -158,8 +158,21 @@ void FileBrowser::UpdateMenu(const QString path){
QDir directory = QDir(path); QDir directory = QDir(path);
AddItem(directory); AddItem(directory);
while(directory.cdUp()){ while(directory.cdUp()){
# if defined(_MSC_VER)
QDir temp=directory;
if (temp.cdUp()){
AddItem(directory);
}
# else
AddItem(directory); AddItem(directory);
# endif
} }
# if defined(_MSC_VER)
QFileInfoList drive_list=QDir::drives();
for (int i=0;i<drive_list.size();++i) {
AddItem(drive_list[i].dir(), drive_list[i].path());
}
#endif
} }
void FileBrowser::Split(){ void FileBrowser::Split(){
...@@ -169,11 +182,15 @@ void FileBrowser::Split(){ ...@@ -169,11 +182,15 @@ void FileBrowser::Split(){
panels->MoveNextTo(qobject_cast<Widget*>(this), new_file_browser); panels->MoveNextTo(qobject_cast<Widget*>(this), new_file_browser);
} }
void FileBrowser::AddItem(const QDir directory){ void FileBrowser::AddItem(const QDir directory, QString mypath){
QVariant variant = QVariant(directory.path()); QVariant variant = QVariant(directory.path());
QIcon icon = model_->fileIcon(model_->index(variant.toString())); QIcon icon = model_->fileIcon(model_->index(variant.toString()));
if (mypath!=""){
menu_->addItem(icon, mypath,variant);
} else {
menu_->addItem(icon, directory.dirName(),variant); menu_->addItem(icon, directory.dirName(),variant);
} }
}
void FileBrowser::LoadObject(const QModelIndex& index){ void FileBrowser::LoadObject(const QModelIndex& index){
gfx::GfxObjP obj; gfx::GfxObjP obj;
... ...
......
...@@ -54,7 +54,7 @@ private slots: ...@@ -54,7 +54,7 @@ private slots:
private: private:
void LoadObject(const QModelIndex& index); void LoadObject(const QModelIndex& index);
void UpdateMenu(const QString path); void UpdateMenu(const QString path);
void AddItem(const QDir directory); void FileBrowser::AddItem(const QDir directory, QString mypath="");
QComboBox* menu_; QComboBox* menu_;
QDirModel* model_; QDirModel* model_;
QListView* view_; QListView* view_;
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment