Commit 9db3fe2b authored by David Llewellyn-Jones's avatar David Llewellyn-Jones

Updated SVX export to include a manifest file and to output PNG slices as...

Updated SVX export to include a manifest file and to output PNG slices as indexed greyscale to match the specification.
parent 68d08e4b
......@@ -3094,6 +3094,114 @@ Use t to represent time (milliseconds)
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<object class="GtkTable" id="table4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="n_rows">3</property>
<property name="n_columns">2</property>
<child>
<object class="GtkLabel" id="label39">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label40">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label41">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">1</property>
</object>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
<property name="x_padding">4</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="MaterialThicknessLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Material thickness</property>
</object>
<packing>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
<property name="x_padding">4</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="MaterialFill">
<property name="label" translatable="yes">Fill completely</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="MaterialThickness">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char"></property>
<property name="primary_icon_activatable">False</property>
<property name="secondary_icon_activatable">False</property>
<property name="primary_icon_sensitive">True</property>
<property name="secondary_icon_sensitive">True</property>
<property name="adjustment">adjustment7</property>
<property name="climb_rate">1</property>
<property name="digits">2</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
</object>
<packing>
<property name="position">5</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel" id="label38">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Physical</property>
</object>
<packing>
<property name="position">5</property>
<property name="tab_fill">False</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
......@@ -3321,4 +3429,10 @@ Use t to represent time (milliseconds)
<property name="step_increment">0.01</property>
<property name="page_increment">0.01</property>
</object>
<object class="GtkAdjustment" id="adjustment7">
<property name="upper">10000</property>
<property name="value">0.01</property>
<property name="step_increment">0.01</property>
<property name="page_increment">1</property>
</object>
</interface>
......@@ -13,7 +13,7 @@ AC_PROG_CC
AM_PROG_CC_C_O
# Checks for libraries.
PKG_CHECK_MODULES([FUNCTY], [gtk+-2.0 gdk-2.0 gtkglext-1.0 glee libzip])
PKG_CHECK_MODULES([FUNCTY], [gtk+-2.0 gdk-2.0 gtkglext-1.0 glee libzip, libpng])
AC_CHECK_LIB([glut], [glutInit], [], [AC_MSG_ERROR([The glut library is missing.])])
AC_CHECK_LIB([symbolic], [CreateInteger], [], [AC_MSG_ERROR([The symbolic library is missing.])])
......
......@@ -1109,7 +1109,7 @@ void CartesianOutputVoxelSlice (unsigned char * pcData, int nResolution, int nCh
fZFunc = ApproximateOperation (psFuncData->psFunction);
if ((fZFunc > (fZSlice - fZStep)) && (fZFunc < (fZSlice + fZStep))) {
if ((fZFunc < fZSlice) && ((psFuncData->boMaterialFill == TRUE) || (fZFunc > (fZSlice - psFuncData->fMaterialThickness)))) {
ucFill = 255u;
}
else {
......
......@@ -27,6 +27,7 @@
#define FUNCTION0 "1"
#define INFLECTION_ZEROCHECK (0.00001f)
#define RADIUSSTEP_MIN (0.0001)
///////////////////////////////////////////////////////////////////
// Structures and enumerations
......@@ -1764,6 +1765,9 @@ void CurveOutputVoxelSlice (unsigned char * pcData, int nResolution, int nChanne
double fXFunc;
double fYFunc;
double fZFunc;
double fXFuncCentre;
double fYFuncCentre;
double fZFuncCentre;
double fXStep;
double fYStep;
double fZStep;
......@@ -1781,19 +1785,19 @@ void CurveOutputVoxelSlice (unsigned char * pcData, int nResolution, int nChanne
float fSin;
float fCos;
float fRadius;
float fRadiusStart;
float fRadiusEnd;
float fRadiusStep;
fXStep = psFuncData->fXWidth / ((double)nResolution);
fYStep = psFuncData->fYWidth / ((double)nResolution);
fZStep = psFuncData->fZWidth / ((double)nResolution);
nPieces = nResolution;
nSegments = nResolution;
nPieces = floor (((16.0 * nResolution / 256.0) / psFuncData->fAccuracy)) + 1;
nSegments = floor (((16.0 * nResolution / 256.0) / psCurveData->fAccuracyRadius)) + 1;
fZSlice = psFuncData->fZMin + (nSlice * fZStep);
psA = FindVariable (psFuncData->psVariables, "a");
psP = FindVariable (psFuncData->psVariables, "p");
......@@ -1840,26 +1844,44 @@ void CurveOutputVoxelSlice (unsigned char * pcData, int nResolution, int nChanne
vTwist2 = ScaleVector (& vBinormal, fSin);
vOffset = AddVectors (& vTwist1, & vTwist2);
fRadius = ApproximateOperation (psFuncData->psFunction);
fRadiusEnd = ApproximateOperation (psFuncData->psFunction);
// Set the curve position
fXFunc = (vPos.fX + (fRadius * vOffset.fX));
fYFunc = (vPos.fY + (fRadius * vOffset.fY));
fZFunc = (vPos.fZ + (fRadius * vOffset.fZ));
if (psFuncData->boMaterialFill) {
fRadiusStart = 0.0f;
}
else {
fRadiusStart = fRadiusEnd - psFuncData->fMaterialThickness;
if (fRadiusStart < 0.0) {
fRadiusStart = 0.0;
}
}
fRadiusStep = MIN (fXStep, MIN(fYStep, fZStep));
if (fRadiusStep <= 0.0) {
fRadiusStep = RADIUSSTEP_MIN;
}
// Translate the function
fXFunc += psCurveData->fXCentre;
fYFunc += psCurveData->fYCentre;
fZFunc += psCurveData->fZCentre;
fXFuncCentre = vPos.fX + psCurveData->fXCentre;
fYFuncCentre = vPos.fY + psCurveData->fYCentre;
fZFuncCentre = vPos.fZ + psCurveData->fZCentre;
// Convert this to a position on the slice
if ((fZFunc > fZSlice) && (fZFunc < (fZSlice + fZStep))) {
nX = (fXFunc - psFuncData->fXMin) / fXStep;
nY = (fYFunc - psFuncData->fYMin) / fYStep;
if ((nX > 0) && (nX < nResolution) && (nY > 0) && (nY < nResolution)) {
for (nChannel = 0; nChannel < nChannels; nChannel++) {
pcData[(((nX + ((nResolution - nY - 1) * nResolution)) * nChannels) + nChannel)] = 255;
// Fill the full area from the inside
for (fRadius = fRadiusStart; fRadius <= fRadiusEnd; fRadius += fRadiusStep) {
// Set the curve position
fZFunc = (fZFuncCentre + (fRadius * vOffset.fZ));
// Convert this to a position on the slice
if ((fZFunc > fZSlice) && (fZFunc < (fZSlice + fZStep))) {
fXFunc = (fXFuncCentre + (fRadius * vOffset.fX));
fYFunc = (fYFuncCentre + (fRadius * vOffset.fY));
nX = (fXFunc - psFuncData->fXMin) / fXStep;
nY = (fYFunc - psFuncData->fYMin) / fYStep;
if ((nX > 0) && (nX < nResolution) && (nY > 0) && (nY < nResolution)) {
for (nChannel = 0; nChannel < nChannels; nChannel++) {
pcData[(((nX + ((nResolution - nY - 1) * nResolution)) * nChannels) + nChannel)] = 255;
}
}
}
}
......
This diff is collapsed.
......@@ -73,6 +73,8 @@ typedef enum {
FILESAVETAG_BLUE,
FILESAVETAG_ALPHA,
FILESAVETAG_ACCURACY,
FILESAVETAG_MATERIALTHICKNESS,
FILESAVETAG_MATERIALFILL,
FILESAVETAG_TEXFILE,
FILESAVETAG_TEXXSCALE,
......@@ -318,6 +320,12 @@ bool SaveFile (char const * szFilename, bool boConfigure, FunctyPersist * psFunc
fValue = GetFunctionAccuracy ((FuncPersist *)(psFuncList->data));
fprintf(fhFile, "\t\t<accuracy double=\"%f\"/>\n", fValue);
fValue = GetFunctionMaterialThickness ((FuncPersist *)(psFuncList->data));
fprintf(fhFile, "\t\t<material-thickness double=\"%f\"/>\n", fValue);
boValue = GetFunctionMaterialFill ((FuncPersist *)(psFuncList->data));
fprintf (fhFile, "\t\t<material-fill bool=\"%d\"/>\n", boValue);
switch (eFuncType) {
case FUNCTYPE_SPHERICAL:
szValue = SphericalGetXCentreString ((FuncPersist *)(psFuncList->data));
......@@ -586,6 +594,12 @@ void StartElementFuncty (GMarkupParseContext * psContext, gchar const * szElemen
else if (strcmp (szElementName, "accuracy") == 0) {
psFilesaveData->eTag[psFilesaveData->nLevel] = FILESAVETAG_ACCURACY;
}
else if (strcmp (szElementName, "material-thickness") == 0) {
psFilesaveData->eTag[psFilesaveData->nLevel] = FILESAVETAG_MATERIALTHICKNESS;
}
else if (strcmp (szElementName, "material-fill") == 0) {
psFilesaveData->eTag[psFilesaveData->nLevel] = FILESAVETAG_MATERIALFILL;
}
else if (strcmp (szElementName, "centre-x") == 0) {
psFilesaveData->eTag[psFilesaveData->nLevel] = FILESAVETAG_CENTREX;
}
......@@ -920,8 +934,10 @@ void StartElementRange (FILESAVETAG eTag, gchar const * * aszAttributeNames, gch
}
void StartElementFunction (FILESAVETAG eTag, gchar const * * aszAttributeNames, gchar const * * aszAttributeValues, FilesavePersist * psFilesaveData) {
bool boBoolFound;
bool boDoubleFound;
double fValue = 0.0f;
bool boValue = FALSE;
int nAttribute;
FUNCTYPE eFuncType = FUNCTYPE_CARTESIAN;
......@@ -950,6 +966,10 @@ void StartElementFunction (FILESAVETAG eTag, gchar const * * aszAttributeNames,
boDoubleFound = FALSE;
nAttribute = 0;
while (aszAttributeNames[nAttribute] != NULL) {
if (strcmp (aszAttributeNames[nAttribute], "bool") == 0) {
boValue = atoi (aszAttributeValues[nAttribute]);
boBoolFound = TRUE;
}
if (strcmp (aszAttributeNames[nAttribute], "double") == 0) {
fValue = atof (aszAttributeValues[nAttribute]);
boDoubleFound = TRUE;
......@@ -957,11 +977,25 @@ void StartElementFunction (FILESAVETAG eTag, gchar const * * aszAttributeNames,
nAttribute++;
}
if (boBoolFound) {
switch (eTag) {
case FILESAVETAG_MATERIALFILL:
SetFunctionMaterialFill (boValue, psFilesaveData->psFuncData);
break;
default:
// Do nothing
break;
}
}
if (boDoubleFound) {
switch (eTag) {
case FILESAVETAG_ACCURACY:
SetFunctionAccuracy (fValue, psFilesaveData->psFuncData);
break;
case FILESAVETAG_MATERIALTHICKNESS:
SetFunctionMaterialThickness (fValue, psFilesaveData->psFuncData);
break;
case FILESAVETAG_ACCURACYRADIUS:
CurveSetFunctionAccuracyRadius (fValue, psFilesaveData->psFuncData);
break;
......
......@@ -132,6 +132,9 @@ FuncPersist * NewFuncPersist (FUNCTYPE eType) {
// Shadow data
psFuncData->psShadowData = NULL;
psFuncData->boMaterialFill = FALSE;
psFuncData->fMaterialThickness = 0.1f;
return psFuncData;
}
......@@ -1390,5 +1393,19 @@ void OutputVoxelSlice (unsigned char * pcData, int nResolution, int nChannels, i
}
}
void SetFunctionMaterialFill (bool boMaterialFill, FuncPersist * psFuncData) {
psFuncData->boMaterialFill = boMaterialFill;
}
bool GetFunctionMaterialFill (FuncPersist * psFuncData) {
return psFuncData->boMaterialFill;
}
void SetFunctionMaterialThickness (float fMaterialThickness, FuncPersist * psFuncData) {
psFuncData->fMaterialThickness = fMaterialThickness;
}
float GetFunctionMaterialThickness (FuncPersist * psFuncData) {
return psFuncData->fMaterialThickness;
}
......@@ -23,6 +23,7 @@
#define ACCURACY_NEW (0.02)
#define ACCURACY_MIN (0.00000001)
#define MATERIALTHICKNESS_NEW (0.1)
///////////////////////////////////////////////////////////////////
// Structures and enumerations
......@@ -111,6 +112,10 @@ void SetFunctionShadowData (ShadowPersist * psShadowData, FuncPersist * psFuncDa
void SetFunctionTransform (Matrix4 const * pmTransform, FuncPersist * psFuncData);
Matrix4 * GetFunctionTransform (FuncPersist * psFuncData);
void OutputVoxelSlice (unsigned char * pcData, int nResolution, int nChannels, int nSlice, FuncPersist * psFuncData);
void SetFunctionMaterialFill (bool boMaterialFill, FuncPersist * psFuncData);
bool GetFunctionMaterialFill (FuncPersist * psFuncData);
void SetFunctionMaterialThickness (float fMaterialThickness, FuncPersist * psFuncData);
float GetFunctionMaterialThickness (FuncPersist * psFuncData);
///////////////////////////////////////////////////////////////////
// Function definitions
......
......@@ -108,6 +108,10 @@ struct _FuncPersist {
// Shadow variables
ShadowPersist * psShadowData;
// Material variables
bool boMaterialFill;
float fMaterialThickness;
};
///////////////////////////////////////////////////////////////////
......
......@@ -64,6 +64,9 @@
#define CURVE_ZCENTRE (0.0)
#define EXPORTANIM_TIME_MAX (86400)
#define DEFAULT_EXPORTBITMAPNAME "Bitmap.png"
#define DEFAULT_VOXELRESOLUTION (128)
#define DEFAULT_BITMAPWIDTH (512)
#define DEFAULT_BITMAPHEIGHT (512)
///////////////////////////////////////////////////////////////////
// Structures and enumerations
......@@ -194,6 +197,8 @@ static gboolean BitmapWindowSizeToggle (GtkWidget * psWidget, gpointer psData);
static gboolean AboutShow (GtkWidget * psWidget, gpointer psData);
static gboolean DocumentationShow (GtkWidget * psWidget, gpointer psData);
static gboolean HomepageShow (GtkWidget * psWidget, gpointer psData);
void SetMaterialFill (bool boMaterialFill, FunctyPersist * psFunctyData);
static void ToggleMaterialFill (GtkWidget * psWidget, gpointer psData);
///////////////////////////////////////////////////////////////////
// Function definitions
......@@ -232,7 +237,7 @@ FunctyPersist * NewFunctyPersist (void) {
psFunctyData->fExportTimeStart = 0.0;
psFunctyData->fExportTimeEnd = 1.0;
psFunctyData->nExportFrames = 50;
psFunctyData->nVoxelResolution = 512;
psFunctyData->nVoxelResolution = DEFAULT_VOXELRESOLUTION;
psFunctyData->eNextFunctionType = FUNCTYPE_INVALID;
psFunctyData->eButtonBarStyle = BUTTONBARSTYLE_ICONS;
psFunctyData->boShowPanelLeft = TRUE;
......@@ -240,8 +245,8 @@ FunctyPersist * NewFunctyPersist (void) {
psFunctyData->boExportedBitmap = FALSE;
psFunctyData->szExportBitmapName = g_string_new (DEFAULT_EXPORTBITMAPNAME);
psFunctyData->boBitmapScreenDimensions = TRUE;
psFunctyData->nBitmapWidth = 512;
psFunctyData->nBitmapHeight = 512;
psFunctyData->nBitmapWidth = DEFAULT_BITMAPWIDTH;
psFunctyData->nBitmapHeight = DEFAULT_BITMAPHEIGHT;
psFunctyData->szLicence = NULL;
return psFunctyData;
......@@ -836,6 +841,7 @@ static gboolean PlotFunctionApply (GtkWidget * psWidget, gpointer psData) {
GtkWidget * psFunctionList;
GtkWidget * psColourWidget;
GtkWidget * psTexWidget;
GtkWidget * psPhysicalWidget;
gchar * szFunction;
char * szFunctionEdit;
FuncPersist * psFuncData;
......@@ -843,6 +849,8 @@ static gboolean PlotFunctionApply (GtkWidget * psWidget, gpointer psData) {
GtkWidget * psWidgetName;
GtkWidget * psWidgetAcc;
double fAccuracy;
float fThickness;
bool boFill;
char * szRed;
char * szGreen;
char * szBlue;
......@@ -894,6 +902,14 @@ static gboolean PlotFunctionApply (GtkWidget * psWidget, gpointer psData) {
SetFunctionColours (szRed, szGreen, szBlue, szAlpha, psFunctyData->psFuncEdit);
SetTextureValues (szFilename, szXScale, szYScale, szXOffset, szYOffset, psFunctyData->psFuncEdit);
// Set function physical properties
psPhysicalWidget = GTK_WIDGET (gtk_builder_get_object(psFunctyData->psXML, "MaterialThickness"));
fThickness = gtk_spin_button_get_value (GTK_SPIN_BUTTON (psPhysicalWidget));
SetFunctionMaterialThickness (fThickness, psFunctyData->psFuncEdit);
psPhysicalWidget = GTK_WIDGET (gtk_builder_get_object(psFunctyData->psXML, "MaterialFill"));
boFill = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (psPhysicalWidget));
SetFunctionMaterialFill (boFill, psFunctyData->psFuncEdit);
switch (eFuncType) {
case FUNCTYPE_SPHERICAL:
psFunction = GTK_WIDGET (gtk_builder_get_object(psFunctyData->psXML, "FunctionEdit"));
......@@ -1458,6 +1474,29 @@ void SetViewWindowState (FunctyPersist * psFunctyData) {
SetViewPauseAnimation (psFunctyData);
}
void SetMaterialFill (bool boMaterialFill, FunctyPersist * psFunctyData) {
GtkWidget * psWidgetThickness;
if (psFunctyData->psFuncEdit) {
SetFunctionMaterialFill (boMaterialFill, psFunctyData->psFuncEdit);
psWidgetThickness = GTK_WIDGET (gtk_builder_get_object(psFunctyData->psXML, "MaterialThickness"));
gtk_widget_set_sensitive (psWidgetThickness, !boMaterialFill);
psWidgetThickness = GTK_WIDGET (gtk_builder_get_object(psFunctyData->psXML, "MaterialThicknessLabel"));
gtk_widget_set_sensitive (psWidgetThickness, !boMaterialFill);
}
}
static void ToggleMaterialFill (GtkWidget * psWidget, gpointer psData) {
FunctyPersist * psFunctyData = (FunctyPersist * )psData;
bool boMaterialFill;
if (psFunctyData->psFuncEdit) {
boMaterialFill = !GetFunctionMaterialFill (psFunctyData->psFuncEdit);
SetMaterialFill (boMaterialFill, psFunctyData);
}
}
static void SetButtonBarStyleNone (GtkWidget * psWidget, gpointer psData) {
FunctyPersist * psFunctyData = (FunctyPersist * )psData;
......@@ -1703,6 +1742,8 @@ void EditFunction (FuncPersist * psFuncData, FunctyPersist * psFunctyData) {
GtkWidget * psNotebook;
int nPageRemoved;
int nPage;
float fThickness;
bool boFill;
// Populate the Function window using information about the given functions
psFunctyData->psFuncEdit = psFuncData;
......@@ -1764,6 +1805,22 @@ void EditFunction (FuncPersist * psFuncData, FunctyPersist * psFunctyData) {
SetColourButton (psFunctyData);
// Set the values for the physical properties
psWidget = GTK_WIDGET (gtk_builder_get_object(psFunctyData->psXML, "MaterialThickness"));
fThickness = GetFunctionMaterialThickness (psFunctyData->psFuncEdit);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (psWidget), fThickness);
psWidget = GTK_WIDGET (gtk_builder_get_object(psFunctyData->psXML, "MaterialFill"));
boFill = GetFunctionMaterialFill (psFunctyData->psFuncEdit);
g_signal_handlers_block_by_func (psWidget, ToggleMaterialFill, (gpointer)psFunctyData);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (psWidget), boFill);
g_signal_handlers_unblock_by_func (psWidget, ToggleMaterialFill, (gpointer)psFunctyData);
psWidget = GTK_WIDGET (gtk_builder_get_object(psFunctyData->psXML, "MaterialThickness"));
gtk_widget_set_sensitive (psWidget, !boFill);
psWidget = GTK_WIDGET (gtk_builder_get_object(psFunctyData->psXML, "MaterialThicknessLabel"));
gtk_widget_set_sensitive (psWidget, !boFill);
switch (eFuncType) {
case FUNCTYPE_CARTESIAN:
// Hide the centre tab
......@@ -1999,6 +2056,20 @@ void NewCartesianFunction (FunctyPersist * psFunctyData) {
psTexWidget = GTK_WIDGET (gtk_builder_get_object(psFunctyData->psXML, "TexYOffset"));
SetTextViewText (psTexWidget, "0.0");
// Set the values for the physical properties
psWidget = GTK_WIDGET (gtk_builder_get_object(psFunctyData->psXML, "MaterialThickness"));
gtk_spin_button_set_value (GTK_SPIN_BUTTON (psWidget), MATERIALTHICKNESS_NEW);
psWidget = GTK_WIDGET (gtk_builder_get_object(psFunctyData->psXML, "MaterialFill"));
g_signal_handlers_block_by_func (psWidget, ToggleMaterialFill, (gpointer)psFunctyData);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (psWidget), FALSE);
g_signal_handlers_unblock_by_func (psWidget, ToggleMaterialFill, (gpointer)psFunctyData);
psWidget = GTK_WIDGET (gtk_builder_get_object(psFunctyData->psXML, "MaterialThickness"));
gtk_widget_set_sensitive (psWidget, TRUE);
psWidget = GTK_WIDGET (gtk_builder_get_object(psFunctyData->psXML, "MaterialThicknessLabel"));
gtk_widget_set_sensitive (psWidget, TRUE);
// Sort out the visible tabs of the notebook
psNotebook = GTK_WIDGET (gtk_builder_get_object(psFunctyData->psXML, "FunctionNotebook"));
......@@ -4244,6 +4315,12 @@ int main (int argc, char *argv[]) {
//g_signal_connect (psWidget, "activate", G_CALLBACK (PlotFunctionApply), (gpointer)psFunctyData);
//psWidget = GTK_WIDGET (gtk_builder_get_object(psFunctyData->psXML, "TexYOffset"));
//g_signal_connect (psWidget, "activate", G_CALLBACK (PlotFunctionApply), (gpointer)psFunctyData);
psWidget = GTK_WIDGET (gtk_builder_get_object(psFunctyData->psXML, "MaterialFill"));
g_signal_connect (psWidget, "activate", G_CALLBACK (PlotFunctionApply), (gpointer)psFunctyData);
psWidget = GTK_WIDGET (gtk_builder_get_object(psFunctyData->psXML, "MaterialFill"));
g_signal_connect (psWidget, "toggled", G_CALLBACK (ToggleMaterialFill), (gpointer)psFunctyData);
psWidget = GTK_WIDGET (gtk_builder_get_object(psFunctyData->psXML, "Spin"));
g_signal_connect (psWidget, "toggled", G_CALLBACK (ToggleSpinPress), (gpointer)psFunctyData);
......
......@@ -1356,7 +1356,7 @@ void SphericalOutputVoxelSlice (unsigned char * pcData, int nResolution, int nCh
fRFunc = ApproximateOperation (psFuncData->psFunction);
fDistance = sqrt ((fAdjacent * fAdjacent) + (fOpposite * fOpposite) + (fElevation * fElevation));
if ((fRFunc > (fDistance - fZStep)) && (fRFunc < (fDistance + fZStep))) {
if ((fDistance < fRFunc) && ((psFuncData->boMaterialFill == TRUE) || (fDistance > (fRFunc - psFuncData->fMaterialThickness)))) {
ucFill = 255u;
}
else {
......
......@@ -2711,4 +2711,8 @@ void SetScreenBufferToScreen (VisPersist * psVisData) {
psVisData->uScreenBuffer = 0u;
}
double GetCurrentTime (VisPersist * psVisData) {
return psVisData->fCurrentTime;
}
......@@ -132,6 +132,7 @@ int GetScreenWidth (VisPersist * psVisData);
bool ExportBitmap (char const * szFilename, char const * szType, int nHeight, int nWidth, VisPersist * psVisData);
void SetScreenBuffer (GLuint uBuffer, VisPersist * psVisData);
void SetScreenBufferToScreen (VisPersist * psVisData);
double GetCurrentTime (VisPersist * psVisData);
///////////////////////////////////////////////////////////////////
// Function definitions
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment