Compare commits

..

2 commits

Author SHA1 Message Date
mycae
bbb030c56e * new sources 2015-05-01 23:58:27 -04:00
mycae
a800ab9f48 * Update to 0.0.18 2015-05-01 18:58:38 -04:00
11 changed files with 1055 additions and 1 deletions

14
.gitignore vendored Normal file
View file

@ -0,0 +1,14 @@
/3Depict-0.0.2.tar.gz
/3Depict-0.0.3.tar.gz
/3Depict-0.0.6.tar.gz
/3Depict-0.0.7.tar.gz
/3Depict-0.0.8.tar.gz
/3Depict-0.0.9.tar.gz
/3Depict-0.0.10.tar.gz
/3Depict-0.0.11.tar.gz
/3Depict-0.0.12.tar.gz
/3Depict-0.0.13.tar.gz
/3Depict-0.0.14.tar.gz
/3Depict-0.0.15.tar.gz
/3Depict-0.0.16.tar.gz
/3Depict-0.0.18.tar.gz

View file

@ -0,0 +1,27 @@
diff -r 1b997a96b779 src/wxcomponents.cpp
--- src/wx/wxcomponents.cpp Sat Mar 23 17:50:44 2013 +0000
+++ src/wx/wxcomponents.cpp Sat Mar 23 17:56:14 2013 +0000
@@ -857,16 +857,17 @@
//(Oh look Ma, I'm autoconf!)
const char *dirs[] = { ".",
- "/usr/share/fonts/truetype", //Old debian
+ "/usr/local/share/fonts/truetype", // User fonts
"/usr/share/fonts/truetype/freefont", // New debian
"/usr/share/fonts/truetype/ttf-dejavu", //New debian
- "/usr/local/share/fonts/truetype", // User fonts
+ "/usr/share/fonts/truetype", //Old debian
+ "/usr/share/fonts/dejavu", //Fedora
"/usr/X11R6/lib/X11/fonts/truetype",
"/usr/X11R6/lib64/X11/fonts/truetype",
- "/usr/lib/X11/fonts/truetype",// Fedora 32
- "/usr/lib64/X11/fonts/truetype", //Fedora 64
- "/usr/local/lib/X11/fonts/truetype", // Fedora 32 new
- "/usr/local/lib64/X11/fonts/truetype",// Fedora 64 new
+ "/usr/lib/X11/fonts/truetype",
+ "/usr/lib64/X11/fonts/truetype",
+ "/usr/local/lib/X11/fonts/truetype",
+ "/usr/local/lib64/X11/fonts/truetype",
"",
}; //MUST end with "".

View file

@ -0,0 +1,16 @@
diff -r 1b997a96b779 src/gui/mainFrame.cpp
--- src/gui/mainFrame.cpp Sat Mar 23 17:50:44 2013 +0000
+++ src/gui/mainFrame.cpp Sat Mar 23 17:56:36 2013 +0000
@@ -2546,9 +2546,9 @@
string s;
s=locateDataFile("3Depict-manual.pdf");
- //Also Debian makes us use the lowercase "D", so check there too.
- if(!s.size())
- s=locateDataFile("3depict-manual.pdf");
+ //Also Fedora has diff dir
+ if(!wxFileExists(wxStr(s)))
+ s="/usr/share/doc/3Depict-0.0.8/3Depict-0.0.8-manual.pdf";
//If we found it, use the default program associated with that data file

View file

@ -0,0 +1,60 @@
diff -r 084988518fe8 src/common/basics.cpp
--- src/common/basics.cpp Sat Apr 26 09:27:35 2014 -0400
+++ src/common/basics.cpp Sat Apr 26 09:42:07 2014 -0400
@@ -1115,6 +1115,28 @@
return 0;
}
+//FIXME: Why negative?
+bool isNotDirectory(const char *filename)
+{
+#if !defined(__WIN32__) && !defined(__WIN64__)
+ struct stat statbuf;
+
+ if(stat(filename,&statbuf) == -1)
+ return false;
+
+ return (statbuf.st_mode !=S_IFDIR);
+#else
+
+ WARN(false, "Untested function. calling win api");
+ DWORD fileAttribs;
+ fileAttribs=GetFileAttributes((LPCWSTR)filename);
+ if(fileAttribs == INVALID_FILE_ATTRIBUTES)
+ return false;
+
+ return !(fileAttribs & FILE_ATTRIBUTE_DIRECTORY);
+#endif
+}
+
#ifdef DEBUG
bool isValidXML(const char *filename)
{
@@ -1148,27 +1170,6 @@
}
-//FIXME: Why negative?
-bool isNotDirectory(const char *filename)
-{
-#if !defined(__WIN32__) && !defined(__WIN64__)
- struct stat statbuf;
-
- if(stat(filename,&statbuf) == -1)
- return false;
-
- return (statbuf.st_mode !=S_IFDIR);
-#else
-
- WARN(false, "Untested function. calling win api");
- DWORD fileAttribs;
- fileAttribs=GetFileAttributes((LPCWSTR)filename);
- if(fileAttribs == INVALID_FILE_ATTRIBUTES)
- return false;
-
- return !(fileAttribs & FILE_ATTRIBUTE_DIRECTORY);
-#endif
-}
bool rmFile(const std::string &filename)
{

View file

@ -0,0 +1,497 @@
diff -r 34e37068b6c7 -r 47f4a1712c25 src/backend/plot.cpp
--- src/backend/plot.cpp Thu Apr 17 22:17:56 2014 +0100
+++ src/backend/plot.cpp Thu Apr 24 00:06:18 2014 +0100
@@ -47,118 +47,8 @@
// perform a little "push off" by this fudge factor
const float AXIS_MIN_TOLERANCE=10*sqrtf(std::numeric_limits<float>::epsilon());
-int MGLColourFixer::maxCols=-1;
+const unsigned int MGL_RESERVED_COLOURS=2;
-void MGLColourFixer::reset()
-{
- rs.clear();
- gs.clear();
- bs.clear();
-}
-
-char MGLColourFixer::haveExactColour(float r, float g, float b) const
-{
- ASSERT(rs.size() == gs.size())
- ASSERT(gs.size() == bs.size())
-
- ASSERT(rs.size() <=getMaxColours());
-
- for(unsigned int ui=0; ui<rs.size(); ui++)
- {
- if( fabs(r-rs[ui]) <std::numeric_limits<float>::epsilon()
- && fabs(g-gs[ui]) <std::numeric_limits<float>::epsilon()
- && fabs(b-bs[ui]) <std::numeric_limits<float>::epsilon())
- return mglColorIds[ui+1].id; //Add one to offset to avoid the reserved "k"
- }
-
- return 0;
-}
-
-unsigned int MGLColourFixer::getMaxColours()
-{
- //Used cached value if available
- if(maxCols!=-1)
- return maxCols;
-
- //The array is statically defined in
- //mgl/mgl_main.cpp, and must end with an id of zero.
- //
- //this is not documented at all.
- maxCols=0;
- while(mglColorIds[maxCols].id)
- maxCols++;
-
- return maxCols;
-}
-
-char MGLColourFixer::getNextBestColour(float r, float g, float b)
-{
- ASSERT(rs.size() == gs.size());
- ASSERT(gs.size() == bs.size());
-
-
- //As a special case, mgl has its own black
- if(r == 0.0f && g == 0.0f && b == 0.0f)
- return mglColorIds[0].id;
-
-
- unsigned int best=0;
- if(rs.size() == getMaxColours())
- {
- ASSERT(getMaxColours());
- //Looks like we ran out of palette colours.
- //lets just give up and try to match this against our existing colours
-
- //TODO: let this modify the existing palette
- // to find a better match.
- float distanceSqr=std::numeric_limits<float>::max();
- for(unsigned int ui=0; ui<rs.size(); ui++)
- {
- float distanceTmp;
- if(r <= 0.5)
- {
- //3,4,2 weighted euclidean distance. Weights allow for closer human perception
- distanceTmp= 3.0*(rs[ui] - r )*(rs[ui] - r ) +4.0*(gs[ui] - g )*(gs[ui] - g )
- + 2.0*(bs[ui] - b )*(bs[ui] - b );
- }
- else
- {
- //use alternate weighting for closer colour perception in "non-red" half of colour cube
- distanceTmp= 2.0*(rs[ui] - r )*(rs[ui] - r ) +4.0*(gs[ui] - g )*(gs[ui] - g )
- + 3.0*(bs[ui] - b )*(bs[ui] - b );
- }
-
- if(distanceTmp < distanceSqr)
- {
- distanceSqr = (distanceTmp);
- best=ui+1; //offset by 1 because mathgl colour 0 is special
- }
-
- }
- }
- else
- {
- char exactMatch;
- //Check to see if we don't already have this
- // no use wasting palette positions on existing
- // colours
- exactMatch=haveExactColour(r,g,b);
-
- if(exactMatch)
- return exactMatch;
-
- //Offset zero is special, for black things, like axes
- best=rs.size()+1;
- mglColorIds[best].col = mglColor(r,g,b);
-
- rs.push_back(r);
- gs.push_back(g);
- bs.push_back(b);
- }
-
- ASSERT(mglColorIds[best].id != 'k');
- return mglColorIds[best].id;
-}
//Mathgl uses some internal for(float=...) constructions,
// which are just generally a bad idea, as they often won't terminate
@@ -209,6 +99,18 @@
}
+std::string mglColourCode(float r, float g, float b)
+{
+ ASSERT(r >=0.0f && g >=0.0f && b >=0.0f)
+ ASSERT(r <=255.0f && g <=255.0f && b <=255.0f)
+ std::string s;
+ genColString((unsigned char)(r*255),
+ (unsigned char)(g*255),(unsigned char)(b*255),s);
+ s=s.substr(1);
+
+ return string("{x") + uppercase(s) + string("}");
+}
+
//TODO: Refactor these functions to use a common string map
//-----------
string plotString(unsigned int traceType)
@@ -806,7 +708,6 @@
}
//Un-fudger for mathgl plots
- MGLColourFixer colourFixer;
bool haveMultiTitles=false;
float minX,maxX,minY,maxY;
@@ -994,17 +895,15 @@
if(!curPlot->visible)
continue;
- curPlot->drawRegions(gr,colourFixer,min,max);
- curPlot->drawPlot(gr,colourFixer);
+ curPlot->drawRegions(gr,min,max);
+ curPlot->drawPlot(gr);
if(drawLegend)
{
//Fake an mgl colour code
- char colourCode[2];
- colourCode[0]=colourFixer.getNextBestColour(
- curPlot->r,curPlot->g,curPlot->b);
- colourCode[1]='\0';
- gr->AddLegend(curPlot->title.c_str(),colourCode);
+ std::string mglColStr;
+ mglColStr= mglColourCode(curPlot->r,curPlot->g,curPlot->b);
+ gr->AddLegend(curPlot->title.c_str(),mglColStr.c_str());
}
}
@@ -1017,7 +916,7 @@
vector<pair<size_t,size_t> > overlapId;
vector<pair<float,float> > overlapXCoords;
- char colourCode=colourFixer.getNextBestColour(1.0f,0.0f,0.0f);
+ string colourCode=mglColourCode(1.0f,0.0f,0.0f);
getRegionOverlaps(overlapId,overlapXCoords);
float rMinY,rMaxY;
@@ -1045,10 +944,10 @@
#ifdef USE_MGL2
gr->FaceZ(mglPoint(rMinX,rMinY,-1),rMaxX-rMinX,rMaxY-rMinY,
- &colourCode);
+ colourCode.c_str());
#else
gr->FaceZ(rMinX,rMinY,-1,rMaxX-rMinX,rMaxY-rMinY,
- &colourCode);
+ colourCode.c_str());
#endif
}
@@ -1082,7 +981,7 @@
#endif
}
- overlays.draw(gr,colourFixer,min,max,haveUsedLog);
+ overlays.draw(gr,min,max,haveUsedLog);
}
void PlotWrapper::hideAll()
@@ -1405,7 +1304,7 @@
return xValues.empty();
}
-void Plot1D::drawPlot(mglGraph *gr,MGLColourFixer &fixer) const
+void Plot1D::drawPlot(mglGraph *gr) const
{
bool showErrs;
@@ -1453,9 +1352,8 @@
//Obtain a colour code to use for the plot, based upon
// the actual colour we wish to use
- char colourCode[2];
- colourCode[0]=fixer.getNextBestColour(r,g,b);
- colourCode[1]='\0';
+ string colourCode;
+ colourCode=mglColourCode(r,g,b);
//---
@@ -1467,23 +1365,23 @@
//rather than linear interpolating them back along their paths. I have emailed the author.
//for now, we shall have to put up with missing lines :( Absolute worst case, I may have to draw them myself.
gr->SetCut(true);
-
- gr->Plot(xDat,yDat,colourCode);
+
+ gr->Plot(xDat,yDat,colourCode.c_str());
if(showErrs)
- gr->Error(xDat,yDat,eDat,colourCode);
+ gr->Error(xDat,yDat,eDat,colourCode.c_str());
gr->SetCut(false);
break;
case PLOT_TRACE_BARS:
- gr->Bars(xDat,yDat,colourCode);
+ gr->Bars(xDat,yDat,colourCode.c_str());
break;
case PLOT_TRACE_STEPS:
//Same problem as for line plot.
gr->SetCut(true);
- gr->Step(xDat,yDat,colourCode);
+ gr->Step(xDat,yDat,colourCode.c_str());
gr->SetCut(false);
break;
case PLOT_TRACE_STEM:
- gr->Stem(xDat,yDat,colourCode);
+ gr->Stem(xDat,yDat,colourCode.c_str());
break;
case PLOT_TRACE_POINTS:
@@ -1557,13 +1455,11 @@
regionGroup.clear();
}
-void Plot1D::drawRegions(mglGraph *gr,MGLColourFixer &fixer,
+void Plot1D::drawRegions(mglGraph *gr,
const mglPoint &min,const mglPoint &max) const
{
//Mathgl palette colour name
- char colourCode[2];
- colourCode[1]='\0';
-
+ string colourCode;
for(unsigned int uj=0;uj<regionGroup.regions.size();uj++)
{
@@ -1577,16 +1473,15 @@
//Prevent drawing inverted regionGroup.regions
if(rMaxX > rMinX && rMaxY > rMinY)
{
- colourCode[0] = fixer.getNextBestColour(regionGroup.regions[uj].r,
+ colourCode = mglColourCode(regionGroup.regions[uj].r,
regionGroup.regions[uj].g,
regionGroup.regions[uj].b);
- colourCode[1] = '\0';
#ifdef USE_MGL2
gr->FaceZ(mglPoint(rMinX,rMinY,-1),rMaxX-rMinX,rMaxY-rMinY,
- colourCode);
+ colourCode.c_str());
#else
gr->FaceZ(rMinX,rMinY,-1,rMaxX-rMinX,rMaxY-rMinY,
- colourCode);
+ colourCode.c_str());
#endif
}
@@ -1791,18 +1686,17 @@
}
-void PlotOverlays::draw(mglGraph *gr,MGLColourFixer &fixer,
+void PlotOverlays::draw(mglGraph *gr,
const mglPoint &boundMin, const mglPoint &boundMax,bool logMode ) const
{
if(!isEnabled)
return;
- char colourCode[2];
+ string colourCode;
//Draw the overlays in black
- colourCode[0] = fixer.getNextBestColour(0.0,0.0,0.0);
- colourCode[1]='\0';
+ colourCode = mglColourCode(0.0,0.0,0.0);
for(size_t ui=0;ui<overlayData.size();ui++)
{
@@ -1841,6 +1735,7 @@
}
}
+ //TODO: Deprecate me. Upstream now allows single stems
//Draw stems. can't use stem plot due to mathgl bug whereby single stems
// will not be drawn
for(size_t uj=0;uj<overlayData[ui].coordData.size();uj++)
@@ -1849,7 +1744,7 @@
boundMin.y < bufY[uj])
{
gr->Line (mglPoint(bufX[uj],std::max(0.0f,(float)boundMin.y)),
- mglPoint(bufX[uj],bufY[uj]),colourCode,100);
+ mglPoint(bufX[uj],bufY[uj]),colourCode.c_str(),100);
//Print labels near to the text
const float STANDOFF_FACTOR=1.05;
diff -r 34e37068b6c7 -r 47f4a1712c25 src/backend/plot.h
--- src/backend/plot.h Thu Apr 17 22:17:56 2014 +0100
+++ src/backend/plot.h Thu Apr 24 00:06:18 2014 +0100
@@ -64,26 +64,6 @@
//!Return the error mode type, given the human readable string
unsigned int plotErrmodeID(const std::string &s);
-//!Nasty hack class to change mathgl API from named char palette to rgb specification
-class MGLColourFixer
-{
- private:
- vector<float> rs,gs,bs;
- static int maxCols;
- public:
- //Restore the MGL colour strings
- void reset();
- //Return the exact colour, if there is one
- char haveExactColour(float r, float g, float b) const;
- //Get the best colour that is available
- // returns the char to give to mathgl; may be exact,
- // maybe nearest match, depending upon number of colours used
- // and mgl palette size
- char getNextBestColour(float r, float g, float b);
-
- static unsigned int getMaxColours();
-};
-
//!Data class for holding info about non-overlapping
// interactive rectilinear "zones" overlaid on plots
@@ -199,7 +179,7 @@
//Add a new overlay to the plot
void add(const OVERLAY_DATA &overlay) {overlayData.push_back(overlay);}
//Draw the overlay on the current plot
- void draw(mglGraph *g,MGLColourFixer &fixer,
+ void draw(mglGraph *g,
const mglPoint &boundMin, const mglPoint &boundMax,bool logMode) const;
//Enable the specified overlay
void setEnabled(size_t offset,bool isEnabled)
@@ -262,7 +242,7 @@
virtual bool empty() const=0;
//Draw the plot onto a given MGL graph
- virtual void drawPlot(mglGraph *graph, MGLColourFixer &fixer) const=0;
+ virtual void drawPlot(mglGraph *graph) const=0;
//!Scan for the data bounds.
virtual void getBounds(float &xMin,float &xMax,
@@ -309,11 +289,10 @@
//Draw the plot onto a given MGL graph
- virtual void drawPlot(mglGraph *graph,MGLColourFixer &fixer) const;
+ virtual void drawPlot(mglGraph *graph) const;
//Draw the associated regions
- void drawRegions(mglGraph *graph, MGLColourFixer &fixer,
- const mglPoint &min, const mglPoint &max) const;
+ void drawRegions(mglGraph *graph,const mglPoint &min, const mglPoint &max) const;
//!Retrieve the raw data associated with the currently visible plots.
diff -r 34e37068b6c7 -r 47f4a1712c25 src/common/stringFuncs.cpp
--- src/common/stringFuncs.cpp Thu Apr 17 22:17:56 2014 +0100
+++ src/common/stringFuncs.cpp Thu Apr 24 00:06:18 2014 +0100
@@ -457,6 +457,16 @@
return s;
}
+std::string uppercase(std::string s)
+{
+ for(unsigned int ui=0;ui<s.size();ui++)
+ {
+ if(isascii(s[ui]) && islower(s[ui]))
+ s[ui] = toupper(s[ui]);
+ }
+ return s;
+}
+
//Split strings around a delimiter
void splitStrsRef(const char *cpStr, const char delim,std::vector<string> &v )
{
diff -r 34e37068b6c7 -r 47f4a1712c25 src/common/stringFuncs.h
--- src/common/stringFuncs.h Thu Apr 17 22:17:56 2014 +0100
+++ src/common/stringFuncs.h Thu Apr 24 00:06:18 2014 +0100
@@ -61,6 +61,8 @@
std::string stripChars(const std::string &Str, const char *chars);
//!Return a lowercase version for a given string
std::string lowercase(std::string s);
+//!Return a uppercase version for a given string
+std::string uppercase(std::string s);
//Drop empty entries from a string of vector
void stripZeroEntries(std::vector<std::string> &s);
@@ -71,9 +73,11 @@
unsigned char &r, unsigned char &g, unsigned char &b, unsigned char &a);
//Convert an RGBA 8-bit/channel quadruplet into its hexadecimal colour string
+// format is "#rrggbbaa" such as "#11ee00aa"
void genColString(unsigned char r, unsigned char g,
unsigned char b, unsigned char a, std::string &s);
//Convert an RGB 8-bit/channel quadruplet into its hexadecimal colour string
+// format is "#rrggbb" such as "#11ee00"
void genColString(unsigned char r, unsigned char g,
unsigned char b, std::string &s);
diff -r 34e37068b6c7 -r 47f4a1712c25 src/gui/dialogs/rangeEditDialog.cpp
--- src/gui/dialogs/rangeEditDialog.cpp Thu Apr 17 22:17:56 2014 +0100
+++ src/gui/dialogs/rangeEditDialog.cpp Thu Apr 24 00:06:18 2014 +0100
@@ -288,7 +288,7 @@
EVT_CHECKLISTBOX(ID_LIST_OVERLAY, RangeEditorDialog::OnListOverlayCheck)
EVT_BUTTON(wxID_OK, RangeEditorDialog::OnBtnOK)
EVT_BUTTON(wxID_CANCEL, RangeEditorDialog::OnBtnCancel)
- EVT_SPLITTER_UNSPLIT(ID_SPLIT_LEFTRIGHT, RangeEditorDialog::OnSashVerticalUnsplit)
+ EVT_SPLITTER_DCLICK(ID_SPLIT_LEFTRIGHT, RangeEditorDialog::OnSashVerticalDClick)
// end wxGlade
END_EVENT_TABLE();
@@ -1438,7 +1438,7 @@
plotPanel->Refresh();
}
-void RangeEditorDialog::OnSashVerticalUnsplit(wxSplitterEvent &event)
+void RangeEditorDialog::OnSashVerticalDClick(wxSplitterEvent &event)
{
event.Veto();
}
diff -r 34e37068b6c7 -r 47f4a1712c25 src/gui/dialogs/rangeEditDialog.h
--- src/gui/dialogs/rangeEditDialog.h Thu Apr 17 22:17:56 2014 +0100
+++ src/gui/dialogs/rangeEditDialog.h Thu Apr 24 00:06:18 2014 +0100
@@ -210,7 +210,7 @@
virtual void OnCheckShowOverlay(wxCommandEvent &event); // wxGlade: <event_handler>
virtual void OnBtnOK(wxCommandEvent &event); // wxGlade: <event_handler>
virtual void OnBtnCancel(wxCommandEvent &event); // wxGlade: <event_handler>
- virtual void OnSashVerticalUnsplit(wxSplitterEvent &event); // wxGlade: <event_handler>
+ virtual void OnSashVerticalDClick(wxSplitterEvent &event); // wxGlade: <event_handler>
virtual void OnListOverlayCheck(wxCommandEvent &event);
virtual void OnListOverlayKeyDown(wxListEvent &event);
virtual void OnTextOverlay(wxCommandEvent &event);
diff -r 34e37068b6c7 -r 47f4a1712c25 src/gui/mainFrame.cpp
--- src/gui/mainFrame.cpp Thu Apr 17 22:17:56 2014 +0100
+++ src/gui/mainFrame.cpp Thu Apr 24 00:06:18 2014 +0100
@@ -1143,9 +1143,12 @@
f->setRangeData(rng);
f->setRangeFilename(s.c_str());
- //Get the parent filter pointer
+ //Add the filter, using the seelcted
+ // item as the parent
visControl.addFilter(f,false,filterId);
+ //update the tree control
+ visControl.updateWxTreeCtrl(treeFilters);
}
else
{
@@ -1398,6 +1401,10 @@
}
setSaveStatus();
+
+ //make sure camera is properly centred
+ if(visControl.numCams() == 1)
+ visControl.ensureSceneVisible(3);
}
}

View file

@ -0,0 +1,27 @@
diff -r 7abb69436c2b src/wx/wxcomponents.cpp
--- src/wx/wxcomponents.cpp Sat Aug 02 05:39:24 2014 -0400
+++ src/wx/wxcomponents.cpp Sat Aug 02 05:40:51 2014 -0400
@@ -547,16 +547,17 @@
//(Oh look Ma, I'm autoconf!)
const char *dirs[] = { ".",
- "/usr/share/fonts/truetype", //Old debian
+ "/usr/local/share/fonts/truetype", // User fonts
"/usr/share/fonts/truetype/freefont", // New debian
"/usr/share/fonts/truetype/ttf-dejavu", //New debian
- "/usr/local/share/fonts/truetype", // User fonts
+ "/usr/share/fonts/truetype", //Old debian
+ "/usr/share/fonts/dejavu", //Fedora
"/usr/X11R6/lib/X11/fonts/truetype",
"/usr/X11R6/lib64/X11/fonts/truetype",
- "/usr/lib/X11/fonts/truetype",// Fedora 32
- "/usr/lib64/X11/fonts/truetype", //Fedora 64
- "/usr/local/lib/X11/fonts/truetype", // Fedora 32 new
- "/usr/local/lib64/X11/fonts/truetype",// Fedora 64 new
+ "/usr/lib/X11/fonts/truetype",
+ "/usr/lib64/X11/fonts/truetype",
+ "/usr/local/lib/X11/fonts/truetype",
+ "/usr/local/lib64/X11/fonts/truetype",
"",
}; //MUST end with "".

View file

@ -0,0 +1,16 @@
diff -r 7abb69436c2b src/gui/mainFrame.cpp
--- src/gui/mainFrame.cpp Sat Aug 02 05:39:24 2014 -0400
+++ src/gui/mainFrame.cpp Sat Aug 02 05:40:32 2014 -0400
@@ -2840,9 +2840,9 @@
string s;
s=locateDataFile("3Depict-manual.pdf");
- //Also Debian makes us use the lowercase "D", so check there too.
- if(!s.size())
- s=locateDataFile("3depict-manual.pdf");
+ //Also Fedora has diff dir
+ if(!wxFileExists(s))
+ s="/usr/share/doc/3Depict-0.0.8/3Depict-0.0.8-manual.pdf";
//FIXME: under windows, currently we use "manual.pdf"
if(!s.size())

View file

@ -0,0 +1,171 @@
diff -r 7510fdcc8b8a -r 185ccbce5421 src/3Depict.cpp
--- src/3Depict.cpp Mon Aug 25 14:41:48 2014 +0100
+++ src/3Depict.cpp Mon Aug 25 14:42:29 2014 +0100
@@ -39,6 +39,12 @@
class threeDepictApp: public wxApp {
private:
+#ifndef DEBUG
+ //instance of this class suppresses internal wx error dialogs.
+ // these are a nuisance in release code, as recovered errors often annoy the user
+ wxLogNull nullifyLogs;
+#endif
+
MainWindowFrame* MainFrame ;
wxArrayString commandLineFiles;
wxLocale* usrLocale;
@@ -62,9 +68,6 @@
void MacReopenFile(const wxString & fileName);
#endif
-#ifdef DEBUG
- void setEventloggerFile(const char *file);
-#endif
};
//Check version is in place because wxT is deprecated for wx 2.9
diff -r 185ccbce5421 -r c8ff86119e58 src/backend/filters/clusterAnalysis.cpp
--- src/backend/filters/clusterAnalysis.cpp Mon Aug 25 14:42:29 2014 +0100
+++ src/backend/filters/clusterAnalysis.cpp Mon Aug 25 14:43:10 2014 +0100
@@ -264,7 +264,7 @@
ClusterAnalysisFilter::ClusterAnalysisFilter() : algorithm(CLUSTER_LINK_ERODE),
enableCoreClassify(false), coreDist(0.0f), coreKNN(1), linkDist(0.5f),
- enableBulkLink(false), bulkLink(1), enableErosion(false), dErosion(0.25),
+ enableBulkLink(false), bulkLink(0.25), enableErosion(false), dErosion(0.25),
wantClusterID(false), wantCropSize(false), nMin(0),nMax(std::numeric_limits<size_t>::max()),
wantClusterSizeDist(false),logClusterSize(false),
wantClusterComposition(true),normaliseComposition(true),
diff -r c8ff86119e58 -r 55ec5e056846 src/gui/mainFrame.cpp
--- src/gui/mainFrame.cpp Mon Aug 25 14:43:10 2014 +0100
+++ src/gui/mainFrame.cpp Mon Aug 25 14:51:53 2014 +0100
@@ -464,7 +464,7 @@
fileExport->Append(ID_FILE_EXPORT_IMAGE, TRANS("&Image...\tCtrl+I"), TRANS("Export Current 3D View"), wxITEM_NORMAL);
fileExport->Append(ID_FILE_EXPORT_IONS, TRANS("Ion&s...\tCtrl+N"), TRANS("Export Ion Data"), wxITEM_NORMAL);
fileExport->Append(ID_FILE_EXPORT_RANGE, TRANS("Ran&ges...\tCtrl+G"), TRANS("Export Range Data"), wxITEM_NORMAL);
- fileExport->Append(ID_FILE_EXPORT_FILTER_ANIMATION, TRANS("&Animate Filters...\tCtrl+A"), TRANS("Export Animated Filter"), wxITEM_NORMAL);
+ fileExport->Append(ID_FILE_EXPORT_FILTER_ANIMATION, TRANS("&Animate Filters...\tCtrl+T"), TRANS("Export Animated Filter"), wxITEM_NORMAL);
fileExport->Append(ID_FILE_EXPORT_ANIMATION, TRANS("Ani&mate Camera...\tCtrl+M"), TRANS("Export Animated Camera"), wxITEM_NORMAL);
fileExport->Append(ID_FILE_EXPORT_PACKAGE, TRANS("Pac&kage...\tCtrl+K"), TRANS("Export analysis package"), wxITEM_NORMAL);
diff -r 9d545342c3ad -r 3c853d1f5af7 src/backend/filters/externalProgram.cpp
--- src/backend/filters/externalProgram.cpp Mon Aug 25 14:52:42 2014 +0100
+++ src/backend/filters/externalProgram.cpp Mon Aug 25 14:53:04 2014 +0100
@@ -551,7 +551,7 @@
p.name=TRANS("Work Dir");
p.data= workingDir;
- p.type=PROPERTY_TYPE_STRING;
+ p.type=PROPERTY_TYPE_DIR;
p.helpText=TRANS("Directory to run the command in");
p.key=EXTERNALPROGRAM_KEY_WORKDIR;
propertyList.addProperty(p,curGroup);
diff -r 9d545342c3ad -r 3c853d1f5af7 src/common/constants.h
--- src/common/constants.h Mon Aug 25 14:52:42 2014 +0100
+++ src/common/constants.h Mon Aug 25 14:53:04 2014 +0100
@@ -57,6 +57,7 @@
PROPERTY_TYPE_POINT3D,
PROPERTY_TYPE_CHOICE,
PROPERTY_TYPE_FILE,
+ PROPERTY_TYPE_DIR,
PROPERTY_TYPE_ENUM_END //Not a prop, just end of enum
};
diff -r 9d545342c3ad -r 3c853d1f5af7 src/wx/propertyGridUpdater.cpp
--- src/wx/propertyGridUpdater.cpp Mon Aug 25 14:52:42 2014 +0100
+++ src/wx/propertyGridUpdater.cpp Mon Aug 25 14:53:04 2014 +0100
@@ -61,7 +61,7 @@
g->Append(new wxPropertyCategory(string("") + title,title));
- //Set the children of thies property
+ //Set the children of this property
for(size_t uj=0;uj<propGrouping.size();uj++)
{
FilterProperty fp;
@@ -83,6 +83,7 @@
boolVal);
break;
};
+ //TODO: we need a PROPERTY_TYPE_UINT
case PROPERTY_TYPE_INTEGER:
{
long long iV;
@@ -145,16 +146,24 @@
break;
}
+ case PROPERTY_TYPE_DIR:
+ {
+ pgp = new wxDirProperty(fp.name,keyStr,fp.data);
+ break;
+ }
}
+ //Set the tooltip
pgp->SetHelpString(fp.helpText);
+ //add the property to the grid
g->Append(pgp);
switch(fp.type)
{
case PROPERTY_TYPE_BOOL:
{
+ //if a bool property, use a checkbox to edit
g->SetPropertyEditor(pgp,wxPGEditor_CheckBox);
break;
}
diff -r 7372047ee6f9 src/common/basics.cpp
--- src/common/basics.cpp Sun Aug 03 16:58:06 2014 -0400
+++ src/common/basics.cpp Sun Aug 03 17:01:04 2014 -0400
@@ -1471,6 +1471,21 @@
return 0;
}
+bool isNotDirectory(const char *filename)
+{
+ struct stat statbuf;
+
+ if(stat(filename,&statbuf) == -1)
+ return false;
+
+ return (statbuf.st_mode !=S_IFDIR);
+}
+
+bool rmFile(const std::string &filename)
+{
+ return remove(filename.c_str()) == 0;
+}
+
#ifdef DEBUG
bool isValidXML(const char *filename)
{
@@ -1503,27 +1518,6 @@
return true;
}
-#if !defined(__WIN32__) && !defined(__WIN64)
-bool isNotDirectory(const char *filename)
-{
- struct stat statbuf;
-
- if(stat(filename,&statbuf) == -1)
- return false;
-
- return (statbuf.st_mode !=S_IFDIR);
-}
-
-bool rmFile(const std::string &filename)
-{
- return remove(filename.c_str()) == 0;
-}
-#elif defined(__WIN32) || defined(__WIN64)
-bool rmFile(const std::string &filename)
-{
- return DeleteFile((const wchar_t*)filename.c_str()) == 0;
-}
-#endif
#endif

226
3Depict.spec Normal file
View file

@ -0,0 +1,226 @@
Name: 3Depict
Version: 0.0.18
Release: 1%{?dist}
Summary: Valued 3D point cloud visualization and analysis
Group: Applications/Engineering
License: GPLv3+
URL: http://threedepict.sourceforge.net
Source0: http://downloads.sourceforge.net/threedepict/%{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
#Mathgl for plotting
BuildRequires: mathgl-devel
#Mesa for GLU
BuildRequires: libGL-devel
#Libxml2 for file parsing
BuildRequires: libxml2-devel
#FTGL for 3d fonts
BuildRequires: ftgl-devel
#libpng for textures
BuildRequires: libpng-devel
#Desktop file utils for installing desktop file
BuildRequires: desktop-file-utils
#WX widgets
BuildRequires: wxGTK3-devel
#Vigra, for voxelisation
BuildRequires: vigra-devel
#PDF latex build
#BuildRequires: tex(latex)
#Required for surface removal algorithms
BuildRequires: qhull-devel
#Fedora specific PDF dir.
Patch0: %{name}-%{version}-manual-pdf-loc.patch
#Fedora specific font dir
Patch1: %{name}-%{version}-font-path.patch
%description
This software is designed to help users visualize and analyze 3D point clouds
with an associated real value, in a fast and flexible fashion. It is
specifically targeted to atom probe tomography applications, but may be
useful for general scalar valued point data purposes.
%prep
%setup -q
%patch0
%patch1
%build
#Due to bug 1077718, wx-config cannot be specified, due to
# wx2/wx3 conflict.
%configure --disable-debug-checks --enable-openmp-parallel --with-wx-config=wx-config-3.0
make %{?_smp_mflags}
%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot}
# Install the textures
mkdir -p %{buildroot}%{_datadir}/%{name}/textures
cp -p data/textures/*png %{buildroot}%{_datadir}/%{name}/textures/
#Install the manpage
install -Dp -m 644 packaging/manpage/%{name}.1 %{buildroot}%{_mandir}/man1/%{name}.1
desktop-file-install \
--dir %{buildroot}%{_datadir}/applications \
packaging/%{name}.desktop
mkdir -p %{buildroot}%{_datadir}/pixmaps/
install -Dp -m 644 data/textures/tex-source/%{name}-icon.svg %{buildroot}%{_datadir}/pixmaps/%{name}.svg
#install language files
#--
#Remap locale names
mv locales/de_DE/ locales/de/
mkdir -p %{buildroot}/%{_datadir}/locale/
cp -R locales/* %{buildroot}/%{_datadir}/locale/
#Restore the internal build's locale naming
mv locales/de/ locales/de_DE/
#--
#Move the documentation such that it is picked up by the doc macro
mv docs/manual-latex/manual.pdf %{name}-%{version}-manual.pdf
#Locale stuff
%find_lang %{name}
%clean
rm -rf %{buildroot}
%files -f %{name}.lang
%defattr(-,root,root,-)
%doc COPYING AUTHORS ChangeLog README TODO %{name}-%{version}-manual.pdf
%{_bindir}/%{name}
%dir %{_datadir}/%{name}/
%dir %{_datadir}/%{name}/textures
%{_datadir}/%{name}/textures/*.png
%{_datadir}/applications/%{name}.desktop
%{_mandir}/man1/%{name}.1.*
%{_datadir}/pixmaps/*.svg
%changelog
* Fri May 01 2015 D Haley <mycae(a!t)gmx.com> - 0.0.18-1
- Update to 0.0.18
* Sat Oct 11 2014 D Haley <mycae(a!t)gmx.com> - 0.0.17-2
- Rebuild for mathgl 2.3
* Sun Sep 28 2014 D Haley <mycae(a!t)gmx.com> - 0.0.17-1
- Update to 0.0.17
* Fri Jun 06 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.0.16-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Sat Apr 26 2014 D Haley <mycae(a!t)gmx.com> - 0.0.16-1
- Update to 0.0.16
* Wed Feb 12 2014 D Haley <mycae(a!t)gmx.com> - 0.0.15-4
- Rebuild for mgl
* Wed Feb 05 2014 D Haley <mycae(a!t)gmx.com> - 0.0.15-3
- Rebuild for new mgl
- Add upstream patches
* Sun Jan 26 2014 D Haley <mycae(a!t)gmx.com> - 0.0.15-2
- Rebuild for new mgl
* Sun Dec 01 2013 D Haley <mycae(a!t)gmx.com> - 0.0.15-1
- Update to 0.0.15
* Fri Aug 02 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.0.14-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Sat Jul 20 2013 D Haley <mycae(a!t)gmx.com> - 0.0.14-1
- Update to 0.0.14
* Tue Jun 25 2013 D Haley <mycae(a!t)gmx.com> - 0.0.13-2
- Enable mathgl2
* Fri Apr 12 2013 D Haley <mycae(a!t)gmx.com> - 0.0.13-1
- Update to 0.0.13
* Sat Mar 23 2013 D Haley <mycae(a!t)gmx.com> - 0.0.12-4
- Add aarch 64 patch for bug 924960, until next version
* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.0.12-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
* Sun Dec 9 2012 D Haley <mycae(a!t)yahoo.com> - 0.0.12-2
- Import bugfixes from upstream for plot UI and crash fixes
* Sun Nov 25 2012 D Haley <mycae(a!t)yahoo.com> - 0.0.12-1
- Update to 0.0.12
* Mon Apr 2 2012 D Haley <mycae(a!t)yahoo.com> - 0.0.10-1
- Update to 0.0.10
* Tue Feb 28 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.0.9-4
- Rebuilt for c++ ABI breakage
* Thu Jan 12 2012 D Haley <mycae(a!t)yahoo.com> - 0.0.9-3
- Patch to fix FTFBS for gcc 4.7
* Thu Jan 12 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.0.9-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
* Sat Dec 17 2011 D Haley <mycae(a!t)yahoo.com> - 0.0.9-1
- Update to 0.0.9
* Tue Dec 06 2011 Adam Jackson <ajax@redhat.com> - 0.0.8-3
- Rebuild for new libpng
* Sat Oct 29 2011 D Haley <mycae(a!t)yahoo.com> - 0.0.8-2
- Post release fixes for various crash bugs
* Sun Oct 23 2011 D Haley <mycae(a!t)yahoo.com> - 0.0.8-1
- Update to 0.0.8
* Sun Aug 14 2011 D Haley <mycae(a!t)yahoo.com> - 0.0.7-1
- Update to 0.0.7
* Fri May 20 2011 D Haley <mycae(a!t)yahoo.com> - 0.0.6-1
- Update to 0.0.6
* Sun Mar 27 2011 D Haley <mycae(a!t)yahoo.com> - 0.0.5-1
- New upstream release
* Sun Mar 13 2011 D Haley <mycae(a!t)yahoo.com> - 0.0.4-3
- Patch opengl startup code -- peek at gl context. Possible fix for bug 684390
* Sat Feb 12 2011 D Haley <mycae(a!t)yahoo.com> - 0.0.4-2
- Fix bug 677016 - 3Depict no built with rpm opt flags
* Sat Jan 22 2011 D Haley <mycae(a!t)yahoo.com> - 0.0.4-1
- Update to 0.0.4
* Fri Nov 26 2010 D Haley <mycae(a!t)yahoo.com> - 0.0.3-1
- Update to 0.0.3
* Tue Oct 5 2010 D Haley <mycae(a!t)yahoo.com> - 0.0.2-3
- Use tex(latex) virtual package in preference to texlive-latex
* Mon Oct 4 2010 D Haley <mycae(a!t)yahoo.com> - 0.0.2-2
- Add latex build for manual
* Sat Sep 25 2010 D Haley <mycae(a!t)yahoo.com> - 0.0.2-1
- Update to 0.0.2
- Address comments in package review
* Sun Aug 08 2010 D Haley <mycae(a!t)yahoo.com> - 0.0.1-1
- Initial package

View file

@ -1 +0,0 @@
Orphaned for 6+ weeks

1
sources Normal file
View file

@ -0,0 +1 @@
feddf0bf7b81d02e064a2b7cfe81aaeb 3Depict-0.0.18.tar.gz