Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…0&aid=9915&group_id=984) and colorbarcolor (#26)
  • Loading branch information
neurolabusc committed Jul 16, 2021
1 parent 935d6da commit 8afff59
Show file tree
Hide file tree
Showing 15 changed files with 343 additions and 219 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ The Windows and Linux releases includes two versions of Surf Ice: "Surfice" requ

##### Compiling

This project is built using the open source [FreePascal Lazarus](http://www.lazarus-ide.org/) compiler and integrated development environment. You will need to have the LazOpenGLContext and PascalScript packages installed. To do this, launch the Lazarus application and choose Packages/InstallPackages. You will want to select these two packages from the "Available for installation" list. Finally, click the "Save and rebuild" button. Once these are installed, you can load this package and compile it using the Run/Run menu option.
This project is built using the open source [FreePascal Lazarus](http://www.lazarus-ide.org/) compiler and integrated development environment. You will need to have the `LazOpenGLContext` and `PascalScript` packages installed. To do this, launch the Lazarus application and choose Packages/InstallPackages. You will want to select these two packages from the "Available for installation" list. Finally, click the "Save and rebuild" button. Once these are installed, you can load this package and compile it using the Run/Run menu option.

The latest version also allows [Python Scripting](https://github.com/neurolabusc/surf-ice/blob/master/PYTHON.md). To enable this you will need to download and install the [Python-for-Lazarus package](https://github.com/Alexey-T/Python-for-Lazarus). Once you download the package, you can install it in the same way as LazOpenGLContext and PascalScript (described above). Alternatively, if you do not want to enable Python, edit the `opts.inc` file by removing the line `{$DEFINE MYPY}`.
The latest version also allows [Python Scripting](https://github.com/neurolabusc/surf-ice/blob/master/PYTHON.md). To enable this you will need install the [Python-for-Lazarus package](https://github.com/Alexey-T/Python-for-Lazarus): this should be done automatically by the Lazarus graphical interface. Unfortunately, the recent releases no longer support to legacy Python 2.7. If you want to support both Python 2.7 and modern Python 3.x, you will need to install a [special version of this package](https://github.com/neurolabusc/Python27-for-Lazarus). You may have to comment out the line `{$DEFINE PY27}` in the `opts.inc` file unless you use this special version. Once you download the package, you can install it in the same way as LazOpenGLContext and PascalScript (described above). Alternatively, if you do not want to enable Python, edit the `opts.inc` file by removing the line `{$DEFINE MYPY}`.

You can also edit your opts.inc file to build either of the [flavors of Surfice](https://www.nitrc.org/plugins/mwiki/index.php/surfice:MainPage#Versions). Uncomment the line `{$DEFINE COREGL}` for OpenGL 3.3 Core specification, or comment the line `//{$DEFINE COREGL}` for OpenGL 2.1.

Expand Down
21 changes: 14 additions & 7 deletions commandsu.pas
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ procedure CLIP (DEPTH: single);
procedure CLIPAZIMUTHELEVATION (DEPTH,AZI,ELEV: single);
procedure COLORBARPOSITION(P: integer);
procedure COLORBARVISIBLE (VISIBLE: boolean);
procedure COLORBARCOLOR (COLOR: integer);
procedure CONTOUR(layer: integer);
procedure EDGECOLOR(name: string; varies: boolean);
procedure EDGELOAD(lFilename: string);
Expand All @@ -36,7 +37,6 @@ function MESHCREATE(niiname, meshname: string; threshold, decimateFrac: single;
procedure MESHCURV;
procedure MESHHEMISPHERE (VAL: integer);
procedure MESHLOAD(lFilename: string);
procedure MESHLOADBILATERAL(BILAT: boolean);
procedure MESHOVERLAYORDER (FLIP: boolean);
procedure MESHREVERSEFACES;
procedure MESHSAVE(lFilename: string);
Expand Down Expand Up @@ -115,6 +115,7 @@ procedure WAIT (MSEC: integer);
(Ptr:@CLIPAZIMUTHELEVATION;Decl:'CLIPAZIMUTHELEVATION';Vars:'(DEPTH,AZI,ELEV: single)'),
(Ptr:@COLORBARPOSITION;Decl:'COLORBARPOSITION';Vars:'(P: integer)'),
(Ptr:@COLORBARVISIBLE;Decl:'COLORBARVISIBLE';Vars:'(VISIBLE: boolean)'),
(Ptr:@COLORBARCOLOR;Decl:'COLORBARCOLOR';Vars:'(COLOR: integer)'),
(Ptr:@EDGECOLOR;Decl:'EDGECOLOR';Vars:'(name: string; varies: boolean)'),
(Ptr:@EDGECREATE;Decl:'EDGECREATE';Vars:'(filename: string; const mtx: array of single)'),
(Ptr:@EDGESIZE;Decl:'EDGESIZE';Vars:'(size: single; varies: boolean)'),
Expand All @@ -135,7 +136,7 @@ procedure WAIT (MSEC: integer);
(Ptr:@MESHOVERLAYORDER;Decl:'MESHOVERLAYORDER';Vars:'(FLIP: boolean)'),
(Ptr:@MESHSAVE;Decl:'MESHSAVE';Vars:'(lFilename: string)'),
(Ptr:@NODELOAD;Decl:'NODELOAD';Vars:'(lFilename: string)'),
(Ptr:@MESHLOADBILATERAL;Decl:'MESHLOADBILATERAL';Vars:'(BILAT: boolean)'),
//(Ptr:@MESHLOADBILATERAL;Decl:'MESHLOADBILATERAL';Vars:'(BILAT: boolean)'),
(Ptr:@MODALMESSAGE;Decl:'MODALMESSAGE';Vars:'(STR: string)'),
(Ptr:@MODELESSMESSAGE;Decl:'MODELESSMESSAGE';Vars:'(STR: string)'),
(Ptr:@NODECOLOR;Decl:'NODECOLOR';Vars:'(name: string; varies: boolean)'),
Expand Down Expand Up @@ -597,11 +598,6 @@ procedure MESHSAVE(lFilename: string);
end;
end;

procedure MESHLOADBILATERAL (BILAT: boolean);
begin
gPrefs.LoadBilateralLHRH := BILAT;
end;

procedure MESHOVERLAYORDER (FLIP: boolean);
begin
gPrefs.isFlipMeshOverlay:= FLIP;
Expand Down Expand Up @@ -952,6 +948,17 @@ procedure COLORBARVISIBLE (VISIBLE: boolean);
GLForm1.GLBoxRequestUpdate(nil);
end;

procedure COLORBARCOLOR (COLOR: integer);
begin
gPrefs.ColorbarColor := COLOR;
GLForm1.ClrbarClr(gPrefs.ColorbarColor);
if (gPrefs.ColorbarColor = GLForm1.WhiteClrbarMenu.tag) then GLForm1.WhiteClrbarMenu.checked := true;
if (gPrefs.ColorbarColor = GLForm1.TransWhiteClrbarMenu.tag) then GLForm1.TransWhiteClrbarMenu.checked := true;
if (gPrefs.ColorbarColor = GLForm1.BlackClrbarMenu.tag) then GLForm1.BlackClrbarMenu.checked := true;
if (gPrefs.ColorbarColor = GLForm1.TransBlackClrbarMenu.tag) then GLForm1.TransBlackClrbarMenu.checked := true;
GLForm1.GLBoxRequestUpdate(nil);
end;

procedure OVERLAYADDITIVE (ADD: boolean);
begin
if ADD <> GLForm1.AdditiveOverlayMenu.Checked then
Expand Down
2 changes: 1 addition & 1 deletion define_types.pas
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface
{$endif}

const
kVers = 'v1.0.20201102++a';
kVers = 'v1.0.20210716';
NaN : double = 1/0;
kTab = chr(9);
kCR = chr (13);
Expand Down
41 changes: 7 additions & 34 deletions mainunit.lfm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
object GLForm1: TGLForm1
Left = 372
Left = 654
Height = 659
Top = 86
Top = 25
Width = 1004
AllowDropFiles = True
Caption = 'Surf Ice'
Expand All @@ -15,7 +15,7 @@ object GLForm1: TGLForm1
OnDropFiles = FormDropFiles
OnShow = FormShow
Position = poDesktopCenter
LCLVersion = '2.1.0.0'
LCLVersion = '2.3.0.0'
object ToolPanel: TScrollBox
Left = 0
Height = 659
Expand Down Expand Up @@ -76,7 +76,6 @@ object GLForm1: TGLForm1
Top = 100
Width = 47
Caption = 'Darkest'
ParentColor = False
ParentFont = False
end
object LayerDarkEdit: TEdit
Expand Down Expand Up @@ -118,7 +117,6 @@ object GLForm1: TGLForm1
Top = 123
Width = 55
Caption = 'Brightest'
ParentColor = False
ParentFont = False
end
object LayerColorDrop: TComboBox
Expand Down Expand Up @@ -150,7 +148,6 @@ object GLForm1: TGLForm1
Top = 145
Width = 47
Caption = 'Opacity'
ParentColor = False
ParentFont = False
end
object LayerAlphaTrack: TTrackBar
Expand Down Expand Up @@ -211,7 +208,6 @@ object GLForm1: TGLForm1
Width = 37
BorderSpacing.Left = 2
Caption = 'Depth'
ParentColor = False
ParentFont = False
OnClick = DepthLabelClick
end
Expand All @@ -224,7 +220,6 @@ object GLForm1: TGLForm1
Top = 24
Width = 50
Caption = 'Azimuth'
ParentColor = False
ParentFont = False
OnClick = AzimuthLabelClick
end
Expand All @@ -237,7 +232,6 @@ object GLForm1: TGLForm1
Top = 45
Width = 55
Caption = 'Elevation'
ParentColor = False
ParentFont = False
OnClick = ElevationLabelClick
end
Expand Down Expand Up @@ -325,7 +319,6 @@ object GLForm1: TGLForm1
Width = 42
BorderSpacing.Left = 2
Caption = 'Length'
ParentColor = False
ParentFont = False
end
object TrackLengthTrack: TTrackBar
Expand Down Expand Up @@ -377,7 +370,6 @@ object GLForm1: TGLForm1
Top = 24
Width = 36
Caption = 'Width'
ParentColor = False
ParentFont = False
end
object TrackDitherTrack: TTrackBar
Expand Down Expand Up @@ -407,7 +399,6 @@ object GLForm1: TGLForm1
Top = 45
Width = 37
Caption = 'Dither'
ParentColor = False
ParentFont = False
end
object TrackScalarLUTdrop: TComboBox
Expand Down Expand Up @@ -499,7 +490,6 @@ object GLForm1: TGLForm1
Width = 33
BorderSpacing.Left = 2
Caption = 'Color'
ParentColor = False
ParentFont = False
end
object LUTdropNode: TComboBox
Expand Down Expand Up @@ -585,7 +575,6 @@ object GLForm1: TGLForm1
Alignment = taRightJustify
BorderSpacing.Left = 2
Caption = 'Size'
ParentColor = False
ParentFont = False
end
object NodeThreshDrop: TComboBox
Expand Down Expand Up @@ -638,7 +627,6 @@ object GLForm1: TGLForm1
Width = 42
BorderSpacing.Left = 4
Caption = 'Thresh'
ParentColor = False
ParentFont = False
end
object NodeMaxEdit: TFloatSpinEdit
Expand Down Expand Up @@ -706,7 +694,6 @@ object GLForm1: TGLForm1
Width = 33
BorderSpacing.Left = 2
Caption = 'Color'
ParentColor = False
ParentFont = False
end
object LUTdropEdge: TComboBox
Expand Down Expand Up @@ -771,7 +758,6 @@ object GLForm1: TGLForm1
Width = 42
BorderSpacing.Left = 2
Caption = 'Thresh'
ParentColor = False
ParentFont = False
end
object EdgeMinEdit: TFloatSpinEdit
Expand Down Expand Up @@ -840,7 +826,6 @@ object GLForm1: TGLForm1
Width = 25
BorderSpacing.Left = 2
Caption = 'Size'
ParentColor = False
ParentFont = False
end
object EdgeSizeVariesCheck: TCheckBox
Expand Down Expand Up @@ -918,7 +903,6 @@ object GLForm1: TGLForm1
Width = 62
BorderSpacing.Left = 2
Caption = 'Saturation'
ParentColor = False
ParentFont = False
end
object MeshSaturationTrack: TTrackBar
Expand Down Expand Up @@ -966,7 +950,6 @@ object GLForm1: TGLForm1
Top = 24
Width = 82
Caption = 'Transparency'
ParentColor = False
ParentFont = False
end
end
Expand Down Expand Up @@ -1037,7 +1020,6 @@ object GLForm1: TGLForm1
Width = 31
BorderSpacing.Left = 2
Caption = 'XRay'
ParentColor = False
ParentFont = False
ParentShowHint = False
ShowHint = True
Expand Down Expand Up @@ -1073,7 +1055,6 @@ object GLForm1: TGLForm1
Top = 24
Width = 171
Caption = 'Shader For Background only'
ParentColor = False
ParentFont = False
end
end
Expand Down Expand Up @@ -1101,7 +1082,6 @@ object GLForm1: TGLForm1
Width = 31
BorderSpacing.Left = 2
Caption = 'Light'
ParentColor = False
ParentFont = False
ParentShowHint = False
ShowHint = True
Expand Down Expand Up @@ -1200,7 +1180,6 @@ object GLForm1: TGLForm1
BorderSpacing.Left = 6
BorderSpacing.Right = 4
Caption = 'AO'
ParentColor = False
ParentFont = False
ParentShowHint = False
ShowHint = True
Expand Down Expand Up @@ -1236,7 +1215,6 @@ object GLForm1: TGLForm1
Width = 14
BorderSpacing.Left = 2
Caption = 'S1'
ParentColor = False
ParentFont = False
ParentShowHint = False
end
Expand All @@ -1250,7 +1228,6 @@ object GLForm1: TGLForm1
Top = 77
Width = 16
Caption = 'S2'
ParentColor = False
ParentFont = False
ParentShowHint = False
end
Expand Down Expand Up @@ -1298,7 +1275,6 @@ object GLForm1: TGLForm1
Top = 119
Width = 16
Caption = 'S4'
ParentColor = False
ParentFont = False
ParentShowHint = False
end
Expand Down Expand Up @@ -1329,7 +1305,6 @@ object GLForm1: TGLForm1
Top = 140
Width = 16
Caption = 'S5'
ParentColor = False
ParentFont = False
ParentShowHint = False
end
Expand Down Expand Up @@ -1360,7 +1335,6 @@ object GLForm1: TGLForm1
Top = 161
Width = 16
Caption = 'S6'
ParentColor = False
ParentFont = False
ParentShowHint = False
end
Expand All @@ -1374,7 +1348,6 @@ object GLForm1: TGLForm1
Top = 182
Width = 16
Caption = 'S7'
ParentColor = False
ParentFont = False
ParentShowHint = False
end
Expand All @@ -1388,7 +1361,6 @@ object GLForm1: TGLForm1
Top = 203
Width = 16
Caption = 'S8'
ParentColor = False
ParentFont = False
ParentShowHint = False
end
Expand All @@ -1402,7 +1374,6 @@ object GLForm1: TGLForm1
Top = 224
Width = 16
Caption = 'S9'
ParentColor = False
ParentFont = False
ParentShowHint = False
end
Expand All @@ -1416,7 +1387,6 @@ object GLForm1: TGLForm1
Top = 243
Width = 22
Caption = 'S10'
ParentColor = False
ParentFont = False
ParentShowHint = False
end
Expand Down Expand Up @@ -1528,7 +1498,6 @@ object GLForm1: TGLForm1
Top = 98
Width = 16
Caption = 'S3'
ParentColor = False
ParentFont = False
ParentShowHint = False
end
Expand Down Expand Up @@ -1769,6 +1738,10 @@ object GLForm1: TGLForm1
ShortCut = 16463
OnClick = OpenMenuClick
end
object OpenBilateralMenu: TMenuItem
Caption = 'Open Bilateral (.lh, .rh)'
OnClick = OpenBilateralMenuClick
end
object CloseMenu: TMenuItem
Caption = 'Close'
ShortCut = 16471
Expand Down
Loading

0 comments on commit 8afff59

Please sign in to comment.