GrxSensorItem.java
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008, AIST, the University of Tokyo and General Robotix Inc.
3  * All rights reserved. This program is made available under the terms of the
4  * Eclipse Public License v1.0 which accompanies this distribution, and is
5  * available at http://www.eclipse.org/legal/epl-v10.html
6  * Contributors:
7  * General Robotix Inc.
8  * National Institute of Advanced Industrial Science and Technology (AIST)
9  */
10 
11 /*
12  * GrxModelItem.java
13  *
14  * @author Yuichiro Kawasumi (General Robotix, Inc.)
15  * @author Shin'ichiro Nakaoka (AIST)
16  */
17 
18 package com.generalrobotix.ui.item;
19 
20 import javax.media.j3d.Geometry;
21 import javax.media.j3d.IndexedTriangleArray;
22 import javax.media.j3d.QuadArray;
23 import javax.media.j3d.Shape3D;
24 import javax.media.j3d.Switch;
25 import javax.media.j3d.TransparencyAttributes;
26 import javax.media.j3d.TriangleFanArray;
27 import javax.vecmath.Point3f;
28 
29 import jp.go.aist.hrp.simulator.SensorInfo;
30 import jp.go.aist.hrp.simulator.CameraPackage.CameraParameter;
31 import jp.go.aist.hrp.simulator.CameraPackage.CameraType;
32 
36 
40 @SuppressWarnings({ "serial", "unchecked" }) //$NON-NLS-1$ //$NON-NLS-2$
41 public class GrxSensorItem extends GrxShapeTransformItem implements Comparable {
42  public String type_;
43  public int id_;
44  private float[] specValues_;
45  private String specFile_;
46 
47  //SensorInfo info_;
48  private Camera_impl camera_ = null;
49  private Switch switchVisibleArea_ = null;
50 
51  public static final String[] sensorType = { "Vision", "RateGyro" , "Acceleration" , "Force" , "Range" };
52  protected static final String[] sensorTypeComboItem_ = sensorType;
53  protected static final String[] cameraTypeComboItem_ = new String[] { "NONE", "COLOR" , "MONO" , "DEPTH" , "COLOR_DEPTH" , "MONO_DEPTH" };
54 
60  public GrxSensorItem(String name, GrxPluginManager manager, GrxModelItem model, SensorInfo info) {
61  super(name, manager, model);
62  if(info != null){
63  type_ = info.type;
64  id_ = info.id;
65  specValues_ = info.specValues;
66  specFile_ = info.specFile;
67  translation(info.translation);
68  rotation(info.rotation);
69  int n = info.shapeIndices.length;
70  for(int i=0; i<n; i++)
71  addTransformedShapeIndex(info.shapeIndices[i]);
72  buildShapeTransforms(info.inlinedShapeTransformMatrices);
73  }else{
74  id_ = -1;
75  type_ = new String("Force"); //$NON-NLS-1$
76  specValues_ = new float[]{-1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f};
77  translation(new double[]{0.0, 0.0, 0.0});
78  rotation(new double[]{0.0, 0.0, 1.0, 0.0});
79  }
80 
81  initMenu();
82 
83  setProperty("type", type_); //$NON-NLS-1$
84  setProperty("id", String.valueOf(id_)); //$NON-NLS-1$
85  setProperty("alwaysVisible", "false"); //$NON-NLS-1$ //$NON-NLS-2$
86  setIcon("camera.png"); //$NON-NLS-1$
87 
88  if (type_.equals("Vision")) { //$NON-NLS-1$
89  CameraParameter prm = new CameraParameter();
90  prm.defName = new String(name);
91  prm.sensorName = new String(name);
92  prm.sensorId = id_;
93 
94  prm.frontClipDistance = (float)specValues_[0];
95  prm.backClipDistance = (float)specValues_[1];
96  prm.fieldOfView = (float)specValues_[2];
97  try {
98  prm.type = CameraType.from_int((int)specValues_[3]);
99  } catch (Exception e) {
100  prm.type = CameraType.NONE;
101  }
102  prm.width = (int)specValues_[4];
103  prm.height = (int)specValues_[5];
104  prm.frameRate = (float)specValues_[6];
105 
106  setDbl("frontClipDistance", prm.frontClipDistance, 4); //$NON-NLS-1$
107  setDbl("backClipDistance", prm.backClipDistance, 4); //$NON-NLS-1$
108  setDbl("fieldOfView", prm.fieldOfView, 6); //$NON-NLS-1$
109  if (prm.type == CameraType.NONE){
110  setProperty("cameraType", "NONE"); //$NON-NLS-1$ //$NON-NLS-2$
111  }else if (prm.type == CameraType.COLOR){
112  setProperty("cameraType", "COLOR"); //$NON-NLS-1$ //$NON-NLS-2$
113  }else if (prm.type == CameraType.MONO){
114  setProperty("cameraType", "MONO"); //$NON-NLS-1$ //$NON-NLS-2$
115  }else if (prm.type == CameraType.COLOR_DEPTH){
116  setProperty("cameraType", "COLOR_DEPTH"); //$NON-NLS-1$ //$NON-NLS-2$
117  }else if (prm.type == CameraType.MONO_DEPTH){
118  setProperty("cameraType", "MONO_DEPTH"); //$NON-NLS-1$ //$NON-NLS-2$
119  }else if (prm.type == CameraType.DEPTH){
120  setProperty("cameraType", "DEPTH"); //$NON-NLS-1$ //$NON-NLS-2$
121  }
122  setInt("width", prm.width); //$NON-NLS-1$
123  setInt("height", prm.height); //$NON-NLS-1$
124  setDbl("frameRate", prm.frameRate); //$NON-NLS-1$
125  boolean offScreen = false;
126  camera_ = new Camera_impl(prm, offScreen);
127 
128  tg_.addChild(camera_.getBranchGroup());
129  switchVisibleArea_ = SceneGraphModifier._makeSwitchNode(_createShapeOfVisibleArea());
130  tg_.addChild(switchVisibleArea_);
131  }else if(type_.equals("RateGyro")){ //$NON-NLS-1$
132  float[] max = new float[3];
133  max[0] = specValues_[0];
134  max[1] = specValues_[1];
135  max[2] = specValues_[2];
136  setFltAry("maxAngularVelocity", max); //$NON-NLS-1$
137  }else if(type_.equals("Acceleration")){ //$NON-NLS-1$
138  float[] max = new float[3];
139  max[0] = specValues_[0];
140  max[1] = specValues_[1];
141  max[2] = specValues_[2];
142  setFltAry("maxAcceleration", max); //$NON-NLS-1$
143  }else if(type_.equals("Force")){ //$NON-NLS-1$
144  float[] maxf = new float[3];
145  maxf[0] = specValues_[0];
146  maxf[1] = specValues_[1];
147  maxf[2] = specValues_[2];
148  float[] maxt = new float[3];
149  maxt[0] = specValues_[3];
150  maxt[1] = specValues_[4];
151  maxt[2] = specValues_[5];
152  setFltAry("maxForce", maxf); //$NON-NLS-1$
153  setFltAry("maxTorque", maxt); //$NON-NLS-1$
154  }else if(type_.equals("Range")){ //$NON-NLS-1$
155  setFlt("scanAngle", specValues_[0]); //$NON-NLS-1$
156  setFlt("scanStep", specValues_[1]); //$NON-NLS-1$
157  setFlt("scanRate", specValues_[2]); //$NON-NLS-1$
158  setFlt("maxDistance", specValues_[3]); //$NON-NLS-1$
159  switchVisibleArea_ = SceneGraphModifier._makeSwitchNode(_createShapeOfVisibleArea());
160  tg_.addChild(switchVisibleArea_);
161  }
162 
163  }
164 
165  public int compareTo(Object o) {
166  if (o instanceof GrxSensorItem) {
167  GrxSensorItem s = (GrxSensorItem) o;
168  if (getOrder(type_) < getOrder(s.type_))
169  return -1;
170  else{
171  if (id_ < s.id_)
172  return -1;
173  }
174  }
175  return 1;
176  }
177 
183  private int getOrder(String type) {
184  if (type.equals("Force")) //$NON-NLS-1$
185  return 0;
186  else if (type.equals("RateGyro")) //$NON-NLS-1$
187  return 1;
188  else if (type.equals("Acceleration")) //$NON-NLS-1$
189  return 2;
190  else if (type.equals("Vision")) //$NON-NLS-1$
191  return 3;
192  else if (type.equals("Range")) //$NON-NLS-1$
193  return 4;
194  else
195  return -1;
196 
197  }
198 
203  void id(String value){
204  Short id = getShort(value);
205  if (id != null && id_ != id){
206  id_ = id;
207  setShort("id", id); //$NON-NLS-1$
208  if (model_ != null) model_.notifyModified();
209  }
210  }
211 
218  public boolean propertyChanged(String property, String value) {
219  if (property.equals("name")){ //$NON-NLS-1$
220  rename(value);
221  }else if(property.equals("translation")){ //$NON-NLS-1$
222  translation(value);
223  }else if(property.equals("rotation")){ //$NON-NLS-1$
224  rotation(value);
225  }else if(property.equals("id")){ //$NON-NLS-1$
226  id(value);
227  }else if(property.equals("type")){ //$NON-NLS-1$
228  type(value);
229  }else if(property.equals("cameraType")){ //$NON-NLS-1$
230  cameraType(value);
231  }else if(property.equals("alwaysVisible")){ //$NON-NLS-1$
232  if (value.startsWith("true")){ //$NON-NLS-1$
233  setProperty("alwaysVisible", "true"); //$NON-NLS-1$ //$NON-NLS-2$
234  setVisibleArea(true);
235  }else{
236  setProperty("alwaysVisible", "false"); //$NON-NLS-1$ //$NON-NLS-2$
237  setVisibleArea(false);
238  }
239  }else if(property.equals("frameRate")){
240  setProperty("frameRate", value);
241  if (model_ != null) model_.notifyModified();
242  }else{
243  return false;
244  }
245  return true;
246  }
247 
248  public void type(String type){
249  if (type_.equals(type)) return;
250 
251  if (type.equals("Vision")){ //$NON-NLS-1$
252  if (specValues_ == null || specValues_.length != 7){
253  specValues_ = new float[7];
254  _removeSensorSpecificProperties();
255  setProperty("frontClipDistance", "0.01"); //$NON-NLS-1$ //$NON-NLS-2$
256  setProperty("backClipDistance", "10.0"); //$NON-NLS-1$ //$NON-NLS-2$
257  setProperty("fieldOfView", "0.0785398"); //$NON-NLS-1$ //$NON-NLS-2$
258  setProperty("cameraType", "COLOR"); //$NON-NLS-1$ //$NON-NLS-2$
259  setProperty("width", "320"); //$NON-NLS-1$ //$NON-NLS-2$
260  setProperty("height", "240"); //$NON-NLS-1$ //$NON-NLS-2$
261  setProperty("frameRate", "30.0"); //$NON-NLS-1$ //$NON-NLS-2$
262  }
263  specValues_[0] = getFlt("frontClipDistance", null); //$NON-NLS-1$
264  specValues_[1] = getFlt("backClipDistance", null); //$NON-NLS-1$
265  specValues_[2] = getFlt("fieldOfView", null); //$NON-NLS-1$
266  if (getStr("cameraType", "NONE").equals("NONE")){ //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
267  specValues_[3] = CameraType._NONE;
268  }else if(getStr("cameraType", "NONE").equals("COLOR")){ //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
269  specValues_[3] = CameraType._COLOR;
270  }else if(getStr("cameraType", "NONE").equals("MONO")){ //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
271  specValues_[3] = CameraType._MONO;
272  }else if(getStr("cameraType", "NONE").equals("DEPTH")){ //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
273  specValues_[3] = CameraType._DEPTH;
274  }else if(getStr("cameraType", "NONE").equals("COLOR_DEPTH")){ //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
275  specValues_[3] = CameraType._COLOR_DEPTH;
276  }else if(getStr("cameraType", "NONE").equals("MONO_DEPTH")){ //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
277  specValues_[3] = CameraType._MONO_DEPTH;
278  }else{
279  setProperty("cameraType", "NONE"); //$NON-NLS-1$ //$NON-NLS-2$
280  }
281  specValues_[4] = getInt("width", null); //$NON-NLS-1$
282  specValues_[5] = getInt("height", null); //$NON-NLS-1$
283  specValues_[6] = getFlt("frameRate", null); //$NON-NLS-1$
284  // TODO update shape of visible area
285  // TODO update camera_
286  }else if(type.equals("RateGyro")){ //$NON-NLS-1$
287  if (specValues_ == null || specValues_.length != 3 || getProperty("maxAngularVelocity")==null){ //$NON-NLS-1$
288  specValues_ = new float[]{-1.0f, -1.0f, -1.0f};
289  _removeSensorSpecificProperties();
290  setFltAry("maxAngularVelocity", specValues_); //$NON-NLS-1$
291  }
292  specValues_ = getFltAry("maxAngularVelocity", null); //$NON-NLS-1$
293  }else if(type.equals("Acceleration")){ //$NON-NLS-1$
294  if (specValues_ == null || specValues_.length != 3 || getProperty("maxAcceleration")==null){ //$NON-NLS-1$
295  specValues_ = new float[]{-1.0f, -1.0f, -1.0f};
296  _removeSensorSpecificProperties();
297  setFltAry("maxAcceleration", specValues_); //$NON-NLS-1$
298  }
299  specValues_ = getFltAry("maxAcceleration", null); //$NON-NLS-1$
300  }else if(type.equals("Force")){ //$NON-NLS-1$
301  if (specValues_ == null || specValues_.length != 6){
302  specValues_ = new float[]{-1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f};
303  _removeSensorSpecificProperties();
304  setFltAry("maxForce", new float[]{-1.0f, -1.0f, -1.0f}); //$NON-NLS-1$
305  setFltAry("maxTorque", new float[]{-1.0f, -1.0f, -1.0f}); //$NON-NLS-1$
306  }
307  float[] maxf = getFltAry("maxForce", null); //$NON-NLS-1$
308  float[] maxt = getFltAry("maxTorque", null); //$NON-NLS-1$
309  specValues_[0] = maxf[0];
310  specValues_[1] = maxf[1];
311  specValues_[2] = maxf[2];
312  specValues_[3] = maxt[0];
313  specValues_[4] = maxt[1];
314  specValues_[5] = maxt[2];
315  }else if(type.equals("Range")){ //$NON-NLS-1$
316  if (specValues_ == null || specValues_.length != 3){
317  specValues_ = new float[]{3.14159f, 0.1f, 10.0f, 10.0f};
318  _removeSensorSpecificProperties();
319  setFlt("scanAngle", 3.14159f); //$NON-NLS-1$
320  setFlt("scanStep", 0.1f); //$NON-NLS-1$
321  setFlt("scanRate", 10.0f); //$NON-NLS-1$
322  setFlt("maxDistance", 10.0f); //$NON-NLS-1$
323  }
324  specValues_[0] = getFlt("scanAngle", 3.14159f); //$NON-NLS-1$
325  specValues_[1] = getFlt("scanStep", 0.1f); //$NON-NLS-1$
326  specValues_[2] = getFlt("scanRate", 10.0f); //$NON-NLS-1$
327  }else{
328  System.out.println("GrxSensorItem.propertyChanged() : unknown sensor type : "+type_); //$NON-NLS-1$
329  return;
330  }
331  type_ = type;
332  setProperty("type", type); //$NON-NLS-1$
333  if (model_ != null) model_.notifyModified();
334  }
336  // properties of ForceSensor
337  remove("maxForce"); //$NON-NLS-1$
338  remove("maxTorque"); //$NON-NLS-1$
339  // property of Gyro
340  remove("maxAngularVelocity"); //$NON-NLS-1$
341  // property of AccelerationSensor
342  remove("maxAcceleration"); //$NON-NLS-1$
343  // property of VisionSensor
344  remove("frontClipDistance"); //$NON-NLS-1$
345  remove("backClipDistance"); //$NON-NLS-1$
346  remove("fieldOfView"); //$NON-NLS-1$
347  remove("width"); //$NON-NLS-1$
348  remove("height"); //$NON-NLS-1$
349  remove("frameRate"); //$NON-NLS-1$
350  remove("cameraType"); //$NON-NLS-1$
351  // property of RangeSensor
352  remove("scanAngle"); //$NON-NLS-1$
353  remove("scanStep"); //$NON-NLS-1$
354  remove("scanRate"); //$NON-NLS-1$
355  remove("maxDistance"); //$NON-NLS-1$
356  }
357 
363  GrxSensorItem ret = (GrxSensorItem)super.clone();
364 /*
365  Deep copy suspension list
366 */
367 
368  return ret;
369  }
370 
376  private Point3f[] _distances2points(double[] distances){
377  if (type_.equals("Range")){ //$NON-NLS-1$
378  float step = specValues_[1];
379  int half = distances.length/2;
380  float maxD = getFlt("maxDistance", 10.0f);
381  Point3f[] p3f = new Point3f[distances.length*2+1];
382  p3f[0] = new Point3f(0,0,0);
383  double startAngle = -step*half-step/2;
384  for(int i=0; i<distances.length; i++){
385  double distance = distances[i];
386  if(distance==0)
387  distance = maxD;
388  p3f[2*i+1] = new Point3f(
389  (float)(-distance*Math.sin(startAngle)),
390  0.0f,
391  (float)(-distance*Math.cos(startAngle)));
392  startAngle += step;
393  p3f[2*i+2] = new Point3f(
394  (float)(-distance*Math.sin(startAngle)),
395  0.0f,
396  (float)(-distance*Math.cos(startAngle)));
397  }
398  return p3f;
399  }else{
400  return null;
401  }
402  }
407  public void updateShapeOfVisibleArea(double[] distances){
408  if (type_.equals("Range")){ //$NON-NLS-1$
409  Point3f[] p3f = _distances2points(distances);
410  if (p3f == null) return;
411  Shape3D shapeNode = (Shape3D)switchVisibleArea_.getChild(0);
412  Geometry gm = (Geometry)shapeNode.getGeometry(0);
413  if (gm instanceof TriangleFanArray){
414  TriangleFanArray tri = (TriangleFanArray)gm;
415  tri.setCoordinates(0, p3f);
416  }
417  }
418  }
423  private Shape3D _createShapeOfVisibleArea() {
424  if (type_.equals("Range")){ //$NON-NLS-1$
425  double scanAngle = specValues_[0];
426  double step = specValues_[1];
427  float d = specValues_[3];
428  int length = (int)(scanAngle/step);
429  int half = (int)(length/2);
430  Point3f[] p3f = new Point3f[length*2+1];
431  p3f[0] = new Point3f(0,0,0);
432  double startAngle = -step*half-step/2;
433  for(int i=0; i<length; i++){
434  p3f[2*i+1] = new Point3f(
435  (float)(-d*Math.sin(startAngle)),
436  0.0f,
437  (float)(-d*Math.cos(startAngle)));
438  startAngle += step;
439  p3f[2*i+2] = new Point3f(
440  (float)(-d*Math.sin(startAngle)),
441  0.0f,
442  (float)(-d*Math.cos(startAngle)));
443  }
444  int[] stripVertexCounts = { p3f.length };
445  TriangleFanArray tri = new TriangleFanArray(p3f.length,
446  TriangleFanArray.COORDINATES,
447  stripVertexCounts);
448  tri.setCapability(QuadArray.ALLOW_COORDINATE_READ);
449  tri.setCapability(QuadArray.ALLOW_COORDINATE_WRITE);
450  tri.setCoordinates(0, p3f);
451  javax.media.j3d.Appearance app = new javax.media.j3d.Appearance();
452  app.setTransparencyAttributes(
453  new TransparencyAttributes(TransparencyAttributes.FASTEST, 0.5f)
454  );
455  Shape3D s3d = new Shape3D(tri, app);
456  s3d.setCapability(Shape3D.ALLOW_GEOMETRY_READ);
457  s3d.setCapability(Shape3D.ALLOW_GEOMETRY_WRITE);
458  return s3d;
459  }
460  if (camera_ == null) return null;
461 
462  CameraParameter prm = camera_.getCameraParameter();
463  //box
464  float enlarge = 0.001f; //[m] prevent this box is rendered
465  float f = (float)prm.backClipDistance*(1.0f+enlarge);
466  float n = (float)prm.frontClipDistance*(1.0f-enlarge);
467  double theta = prm.fieldOfView;
468  float aspect = ((float)prm.height)/prm.width;
469  float nx = (float)Math.tan(theta/2)*n;
470  float ny = nx*aspect;
471  float fx = (float)Math.tan(theta/2)*f;
472  float fy = fx*aspect;
473 
474  Point3f[] p3f = {
475  new Point3f(nx,ny,-n),
476  new Point3f(-nx,ny,-n),
477  new Point3f(-nx,-ny,-n),
478  new Point3f(nx,-ny,-n),
479  new Point3f(fx,fy,-f),
480  new Point3f(-fx,fy,-f),
481  new Point3f(-fx,-fy,-f),
482  new Point3f(fx,-fy,-f),
483  };
484 
485  int vertIndices[] = {0,1,2,0,2,3,1,0,4,1,4,5,0,3,7,0,7,4,5,2,1,5,6,2,6,7,3,6,3,2,5,4,7,5,7,6};
486  IndexedTriangleArray tri =
487  new IndexedTriangleArray(p3f.length,
488  IndexedTriangleArray.COORDINATES,
489  vertIndices.length);
490 
491  tri.setCoordinates(0, p3f);
492  tri.setCoordinateIndices(0,vertIndices);
493  javax.media.j3d.Appearance app = new javax.media.j3d.Appearance();
494  app.setTransparencyAttributes(
495  new TransparencyAttributes(TransparencyAttributes.FASTEST, 0.5f)
496  );
497  Shape3D s3d = new Shape3D(tri, app);
498  return s3d;
499  }
500 
505  public void setVisibleArea(boolean b) {
506  if (switchVisibleArea_ != null){
507  switchVisibleArea_.setWhichChild(b? Switch.CHILD_ALL:Switch.CHILD_NONE);
508  }
509  }
510 
511  public boolean isVisible(){
512  return switchVisibleArea_ != null && switchVisibleArea_.getWhichChild() == Switch.CHILD_ALL;
513  }
514 
521  public void setFocused(boolean b){
522  if (b)
523  resizeBoundingBox();
524  super.setFocused(b);
525  if (isFalse("alwaysVisible")) setVisibleArea(b); //$NON-NLS-1$
526  }
527 
528  public boolean isCamera(){
529  if(camera_ != null)
530  return true;
531  else
532  return false;
533  }
534 
536  if(isCamera())
537  return camera_;
538  else
539  return null;
540  }
541 
542  private void cameraType(String cameraType){
543  String old = getStr("cameraType", "NONE");
544  if(!type_.equals("Vision") || old.equals(cameraType)) return;
545 
546  if(cameraType.equals("NONE")){ //$NON-NLS-1$
547  specValues_[3] = CameraType._NONE;
548  }else if(cameraType.equals("COLOR")){ //$NON-NLS-1$
549  specValues_[3] = CameraType._COLOR;
550  }else if(cameraType.equals("MONO")){ //$NON-NLS-1$
551  specValues_[3] = CameraType._MONO;
552  }else if(cameraType.equals("DEPTH")){ //$NON-NLS-1$
553  specValues_[3] = CameraType._DEPTH;
554  }else if(cameraType.equals("COLOR_DEPTH")){ //$NON-NLS-1$
555  specValues_[3] = CameraType._COLOR_DEPTH;
556  }else if(cameraType.equals("MONO_DEPTH")){ //$NON-NLS-1$
557  specValues_[3] = CameraType._MONO_DEPTH;
558  }else{
559  System.out.println("GrxSensorItem.propertyChanged() : unknown camera type : " + cameraType); //$NON-NLS-1$
560  return;
561  }
562  setProperty("cameraType", cameraType); //$NON-NLS-1$
563  if (model_ != null) model_.notifyModified();
564  }
565 
566  @Override
567  public ValueEditType GetValueEditType(String key) {
568  if(key.matches("type")) {
569  return new ValueEditCombo(sensorTypeComboItem_);
570  }else if(type_.equals("Vision") && key.equals("cameraType")){
571  return new ValueEditCombo(cameraTypeComboItem_);
572  }
573  if(key.matches("alwaysVisible")){
574  return new ValueEditCombo(booleanComboItem_);
575  }
576  return super.GetValueEditType(key);
577  }
578 }
boolean propertyChanged(String property, String value)
check validity of new value of property and update if valid
png_infop png_charp png_int_32 png_int_32 int * type
Definition: png.h:2332
void setVisibleArea(boolean b)
make visible area visible/invisible
#define null
our own NULL pointer
Definition: IceTypes.h:57
GrxSensorItem(String name, GrxPluginManager manager, GrxModelItem model, SensorInfo info)
constructor
Point3f[] _distances2points(double[] distances)
convert array of distance into array of 3D point
png_infop png_charpp name
Definition: png.h:2382
png_voidp int value
Definition: png.h:2113
RTC::ReturnCode_t ret(RTC::Local::ReturnCode_t r)
item corresponds to a robot model
png_bytep png_bytep png_size_t length
Definition: png.h:1541
png_uint_32 i
Definition: png.h:2735
long b
Definition: jpegint.h:371
ValueEditType GetValueEditType(String key)
int getOrder(String type)
get sensor type as integer value
void updateShapeOfVisibleArea(double[] distances)
update shape of visible area(only used for RangeSensor)
id
void setFocused(boolean b)
set/unset fucus on this item
typedef int
Definition: png.h:1113
backing_store_ptr info
Definition: jmemsys.h:181
GrxSensorItem clone()
Override clone method.
プラグイン管理クラス GrxUIの核になるクラス。プラグインのロード等の、初期化を実行する。 プラグインとそ...
static int max(int a, int b)
Shape3D _createShapeOfVisibleArea()
create shape of visible area


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Sat Apr 13 2019 02:14:22