BioGTK  5.1.1
A .NET library & program for annotating, editing various microscopy imaging formats using Bioformats supported images.
Loading...
Searching...
No Matches
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 ()
 
 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]
 

Member Enumeration Documentation

◆ ToolType

Enumerator
color 
annotation 
select 
function 
86 {
87 color,
89 select,
90 function
91 }
ColorS color
Definition Tools.cs:171

◆ Type

Enumerator
pointSel 
pan 
move 
point 
line 
rect 
ellipse 
polygon 
text 
delete 
freeform 
select 
magic 
brush 
bucket 
eraser 
dropper 
switchColors 
color1 
color2 
script 

Constructor & Destructor Documentation

◆ Tool() [1/5]

BioGTK.Tools.Tool.Tool ( )
inline
173 {
174 tolerance = new ColorS(0, 0, 0);
175 }
ColorS tolerance
Definition Tools.cs:170

◆ Tool() [2/5]

BioGTK.Tools.Tool.Tool ( Type  t)
inline
177 {
178 type = t;
179 tolerance = new ColorS(0, 0, 0);
180 }
Type type
Definition Tools.cs:169

◆ Tool() [3/5]

BioGTK.Tools.Tool.Tool ( Type  t,
ColorS  col 
)
inline
182 {
183 type = t;
184 color = col;
185 tolerance = new ColorS(0, 0, 0);
186 }

◆ Tool() [4/5]

BioGTK.Tools.Tool.Tool ( Type  t,
RectangleD  r 
)
inline
188 {
189 type = t;
190 rect = r;
191 tolerance = new ColorS(0, 0, 0);
192 }

◆ Tool() [5/5]

BioGTK.Tools.Tool.Tool ( Type  t,
string  sc 
)
inline
194 {
195 type = t;
196 script = sc;
197 tolerance = new ColorS(0, 0, 0);
198 }

Member Function Documentation

◆ Init()

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

It adds all the tools to the tools list.

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

◆ ToString()

override string BioGTK.Tools.Tool.ToString ( )
inline
200 {
201 return type.ToString();
202 }

Member Data Documentation

◆ bounds

Rectangle BioGTK.Tools.Tool.bounds

◆ color

ColorS BioGTK.Tools.Tool.color

◆ image

Pixbuf BioGTK.Tools.Tool.image

◆ Points

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

◆ script

string BioGTK.Tools.Tool.script

◆ selected

bool BioGTK.Tools.Tool.selected

◆ tolerance

ColorS BioGTK.Tools.Tool.tolerance

◆ toolType

ToolType BioGTK.Tools.Tool.toolType

◆ type

Type BioGTK.Tools.Tool.type

Property Documentation

◆ Rectangle

RectangleD BioGTK.Tools.Tool.Rectangle
getset
160 {
161 get { return rect; }
162 set { rect = value; }
163 }

◆ RectangleF

RectangleF BioGTK.Tools.Tool.RectangleF
get
165 {
166 get { return new RectangleF((float)rect.X, (float)rect.Y, (float)rect.W, (float)rect.H); }
167 }
RectangleF RectangleF
Definition Tools.cs:165
double W
Definition Bio.cs:316
double X
Definition Bio.cs:314
double Y
Definition Bio.cs:315
double H
Definition Bio.cs:317

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