BioGTK  6.0.0
A .NET library & program for annotating, editing various microscopy imaging formats using Bioformats supported images. Including whole slide, pyramidal, and series.
All Classes Namespaces Functions
BioGTK.Tools.Tool Class Reference

Public Types

enum  ToolType { color , annotation , select , function }
 
enum  Type {
  pointSel , pan , move , point ,
  line , rect , ellipse , polygon ,
  text , delete , freeform , select ,
  magic , brush , bucket , eraser ,
  dropper , switchColors , color1 , color2 ,
  script
}
 

Public Member Functions

 Tool (Type t)
 
 Tool (Type t, ColorS col)
 
 Tool (Type t, RectangleD r)
 
 Tool (Type t, string sc)
 
override string ToString ()
 

Static Public Member Functions

static void Init ()
 It adds all the tools to the tools list.
 

Public Attributes

List< AForge.Point > Points
 
ToolType toolType
 
bool selected
 
Pixbuf image
 
Rectangle bounds
 
string script
 
Type type
 
ColorS tolerance
 
ColorS color
 

Properties

RectangleD Rectangle [get, set]
 
RectangleF RectangleF [get]
 

Detailed Description

Definition at line 86 of file Tools.cs.

Member Enumeration Documentation

◆ ToolType

enum BioGTK.Tools.Tool.ToolType

Definition at line 89 of file Tools.cs.

90 {
91 color,
92 annotation,
93 select,
94 function
95 }

◆ Type

enum BioGTK.Tools.Tool.Type

Definition at line 96 of file Tools.cs.

97 {
98 pointSel,
99 pan,
100 move,
101 point,
102 line,
103 rect,
104 ellipse,
105 polygon,
106 text,
107 delete,
108 freeform,
109 select,
110 magic,
111 brush,
112 bucket,
113 eraser,
114 dropper,
115 switchColors,
116 color1,
117 color2,
118 script,
119 }

Constructor & Destructor Documentation

◆ Tool() [1/5]

BioGTK.Tools.Tool.Tool ( )

Definition at line 176 of file Tools.cs.

177 {
178 tolerance = new ColorS(0, 0, 0);
179 }

◆ Tool() [2/5]

BioGTK.Tools.Tool.Tool ( Type t)

Definition at line 180 of file Tools.cs.

181 {
182 type = t;
183 tolerance = new ColorS(0, 0, 0);
184 }

◆ Tool() [3/5]

BioGTK.Tools.Tool.Tool ( Type t,
ColorS col )

Definition at line 185 of file Tools.cs.

186 {
187 type = t;
188 color = col;
189 tolerance = new ColorS(0, 0, 0);
190 }

◆ Tool() [4/5]

BioGTK.Tools.Tool.Tool ( Type t,
RectangleD r )

Definition at line 191 of file Tools.cs.

192 {
193 type = t;
194 rect = r;
195 tolerance = new ColorS(0, 0, 0);
196 }

◆ Tool() [5/5]

BioGTK.Tools.Tool.Tool ( Type t,
string sc )

Definition at line 197 of file Tools.cs.

198 {
199 type = t;
200 script = sc;
201 tolerance = new ColorS(0, 0, 0);
202 }

Member Function Documentation

◆ Init()

static void BioGTK.Tools.Tool.Init ( )
static

It adds all the tools to the tools list.

Definition at line 122 of file Tools.cs.

123 {
124 int w = 33;
125 int h = 33;
126 string s = System.IO.Path.GetDirectoryName(Environment.ProcessPath) + "/";
127 tools.Clear();
128 if (tools.Count == 0)
129 {
130 int x = 0; int y = 0;
131 foreach (Tool.Type t in (Tool.Type[])Enum.GetValues(typeof(Tool.Type)))
132 {
133 if(t != Type.script)
134 if(t != Type.color1 && t != Type.color2)
135 {
136 Tool tool = new Tool(t, new ColorS(0, 0, 0));
137 tool.bounds = new Rectangle(x * w, y * h, w, h);
138 tool.image = new Pixbuf(s + "Images/" + tool.type.ToString() + ".png");
139 tools.Add(tool.ToString(), tool);
140 }
141 else
142 {
143 Tool tool = new Tool(t, new ColorS(0, 0, 0));
144 tool.bounds = new Rectangle(x * w, y * h, w, h);
145 tools.Add(tool.ToString(), tool);
146 }
147 x++;
148 if(x > Tools.gridW-1)
149 {
150 x = 0;
151 y++;
152 }
153 }
154 }
155 DrawColor = new ColorS(ushort.MaxValue, ushort.MaxValue, ushort.MaxValue);
156 }

◆ ToString()

override string BioGTK.Tools.Tool.ToString ( )

Definition at line 203 of file Tools.cs.

204 {
205 return type.ToString();
206 }

Member Data Documentation

◆ bounds

Rectangle BioGTK.Tools.Tool.bounds

Definition at line 161 of file Tools.cs.

◆ color

ColorS BioGTK.Tools.Tool.color

Definition at line 175 of file Tools.cs.

◆ image

Pixbuf BioGTK.Tools.Tool.image

Definition at line 160 of file Tools.cs.

◆ Points

List<AForge.Point> BioGTK.Tools.Tool.Points

Definition at line 157 of file Tools.cs.

◆ script

string BioGTK.Tools.Tool.script

Definition at line 172 of file Tools.cs.

◆ selected

bool BioGTK.Tools.Tool.selected

Definition at line 159 of file Tools.cs.

◆ tolerance

ColorS BioGTK.Tools.Tool.tolerance

Definition at line 174 of file Tools.cs.

◆ toolType

ToolType BioGTK.Tools.Tool.toolType

Definition at line 158 of file Tools.cs.

◆ type

Type BioGTK.Tools.Tool.type

Definition at line 173 of file Tools.cs.

Property Documentation

◆ Rectangle

RectangleD BioGTK.Tools.Tool.Rectangle
getset

Definition at line 163 of file Tools.cs.

164 {
165 get { return rect; }
166 set { rect = value; }
167 }

◆ RectangleF

RectangleF BioGTK.Tools.Tool.RectangleF
get

Definition at line 168 of file Tools.cs.

169 {
170 get { return new RectangleF((float)rect.X, (float)rect.Y, (float)rect.W, (float)rect.H); }
171 }

The documentation for this class was generated from the following file: