Package org.mt4j.components.clipping

Examples of org.mt4j.components.clipping.Clip


//    MTRoundRectangle clipRect =  new MTRoundRectangle(x+border, y+border, z, width-(2*border), height-(2*border), arcWidth, arcHeight, applet);
    MTRectangle clipRect =  new MTRectangle(x+border, y+border, z, width-(2*border), height-(2*border), applet);
    clipRect.setDrawSmooth(true);
    clipRect.setNoStroke(true);
    clipRect.setBoundsBehaviour(MTRectangle.BOUNDS_ONLY_CHECK);
    this.clip = new Clip(gl, clipRect);
    this.setChildClip(this.clip);
    this.drawInnerBorder = true;
   
    //Add window background
    final MTRectangle windowBackGround = new MTRectangle(x, y, z, 100, 200, applet);
View Full Code Here


      //We dont have to clip since we expand the area
      break;
    case MODE_WRAP:
      if (MT4jSettings.getInstance().isOpenGlMode()){
        //Clip the text to the area
        this.setClip(new Clip(pApplet, this.getVerticesLocal()[0].x, this.getVerticesLocal()[0].y, this.getWidthXY(TransformSpace.LOCAL), this.getHeightXY(TransformSpace.LOCAL)));
      }
      break;
    default:
      break;
    }
View Full Code Here

  @Override
  public void postDrawChildren(PGraphics g) {
    //FIXME this is a hack to draw the outline of the shape
    //over the clipped children, to not process the clipmask
    //in the superclass we set it to null temporary
    Clip saved = this.getChildClip();
    if (saved != null){
      saved.disableClip(g);
      //Draw shape outline over everything for an antialiased outline
      if (!savedNoStrokeSetting){
        boolean noFillSetting = this.isNoFill();
        this.setNoFill(true);
        this.setNoStroke(false);
View Full Code Here

     
      //Transforms the ray into local object space
      Ray invertedRay = this.globalToLocal(ray);
     
      //Check if component is clipped and only proceed if the ray intersects the clip shape
      Clip clip = this.getClip();
      if (clip == null || (clip != null && clip.getClipShapeIntersectionLocal(invertedRay) != null)){
        interSP = this.getIntersectionLocal(invertedRay);
        if (interSP != null){
          //FIXME TRIAL - muss f�r die distance messung der world ray genommen
          //werden oder geht der invertierte ray?
          interSP.transform(this.getGlobalMatrix());
          //Get distance from raystart to the intersecting point
          objDistance = interSP.getSubtracted(ray.getRayStartPoint()).length();

          //If the distance is the smalles yet = closest to the raystart replace the returnObject and current distanceFrom
          if ((objDistance - PickResult.HIT_TOLERANCE) < currentDistance ){
            returnPoint = interSP;
            currentDistance = objDistance;
          }
        }
      }

      //Check for child clip intersection, if not intersecting, dont try to pick children
      Clip childClip = this.getChildClip();
      if (childClip != null && childClip.getClipShapeIntersectionLocal(invertedRay) == null){
        return returnPoint;
      }
     
    }
   
View Full Code Here

      l2.setStrokeColor(255, 10, 10, 255);
      this.getAncestor().addChild(l2);
      */
     
      //Check if component is clipped and only proceed if the ray intersects the clip shape
      Clip clip = this.getClip();
      if (clip == null || (clip != null && clip.getClipShapeIntersectionLocal(invertedRay) != null)){
        interSP = this.getIntersectionLocal(invertedRay);
        if (interSP != null){
          //FIXME TRIAL - muss f�r die distance messung der world ray genommen
          //werden oder geht der invertierte ray? -> musss wohl der world ray sein
          interSP.transform(this.getGlobalMatrix());
          // Get distance from raystart to the intersecting point
          objDistance = interSP.getSubtracted(currentRay.getRayStartPoint()).length();
          //System.out.println("Pick found: " + this.getName() + " InterSP: " + interSP +  " ObjDist: " + objDistance +  " Mouse Pos: " + pickInfo.getScreenXCoordinate() + "," + pickInfo.getScreenYCoordinate() + " InvRay RS:" + invertedRay.getRayStartPoint() + ",RE: " + invertedRay.getPointInRayDirection());

//          //If the distance is the smallest yet = closest to the raystart: replace the returnObject and current distanceFrom
//          if ( (objDistance - HIT_TOLERANCE) <= currObjDist /*|| this.isAlwaysDrawnOnTop()*/){//take isDrawnOnTop into account here?? -> OBJDistance auf 0 setzen?
//          currObjDist = objDistance;
//          pickResult.addPickedObject(this, interSP, objDistance);
////          System.out.println("-> Now nearest: " + this.getName());
//          }

          //FIXME TEST - ADD ALL PICKED OBJECTS - SORT LATER
          pickResult.addPickedObject(this, interSP, objDistance);
        }
      }
     
      //Check for child clipping shape intersection, if not intersecting -> dont try to pick children
      Clip childClip = this.getChildClip();
      if (childClip != null && childClip.getClipShapeIntersectionLocal(invertedRay) == null){
        return currObjDist;
      }
    }
   
    /* recursively check all children now */
 
View Full Code Here

      MTRectangle clipRect = new MTRectangle(x, y, z, width, height, applet);
      clipRect.setNoStroke(true);
      clipRect.setBoundsBehaviour(MTRectangle.BOUNDS_ONLY_CHECK);

      GL gl = ((PGraphicsOpenGL)applet.g).gl;
      Clip clipMask = new Clip(gl, clipRect);
      this.setChildClip(clipMask);
    }
  }
View Full Code Here

      MTRoundRectangle clipRect = new MTRoundRectangle(x, y, z, width, height, arcWidth, arcHeight, applet);
          clipRect.setNoStroke(true);
          clipRect.setBoundsBehaviour(MTRectangle.BOUNDS_ONLY_CHECK);
         
          GL gl = ((PGraphicsOpenGL)applet.g).gl;
          Clip clipMask = new Clip(gl, clipRect);
          this.setChildClip(clipMask);
    }
       
  }
View Full Code Here

TOP

Related Classes of org.mt4j.components.clipping.Clip

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.