Examples of Cuboid


Examples of Hexel.things.types.Cuboid

    Set<Thing> things = this.engine.thingSimulator.things;
    synchronized (things){
      for (Thing thing : things){
        final Thing thing0 = thing;
        if (thing instanceof Cuboid){
          final Cuboid c = (Cuboid)thing;
          ArrayList<Vector3i> blocksIntersectingThing = thingTools.getBlocksIntersectingThing(c, fixOffsetTmps);
          for (Vector3i v : blocksIntersectingThing){
            if (blocksIntersecting.contains(v)){
              thingsIntersecting.add(thing0);
            }
View Full Code Here

Examples of com.inadco.hbl.api.Cuboid

            dimName2GroupKeyOffsetMap = new HashMap<String, Integer>(11);
        if (measureName2indexMap == null)
            measureName2indexMap = new HashMap<String, Integer>(11);
       
        Validate.notNull(cube, "A cube not set");
        Cuboid cuboid = findCuboid();

        Validate.notNull(cuboid, "Unable to find a suitable cuboid for the slice query.");

        /*
         * FIXME, TODO: check slices for overlapping. otherwise, if slices
         * overlap, not only we'd be performing more scans than needed, but they
         * will also contain duplicate counts.
         *
         * for now we just have to assume that slices will not overlap.
         */
        List<ScanSpec> scanSpecs = new ArrayList<ScanSpec>();

        List<Range> partialSpec = new ArrayList<Range>();

        int groupKeyLen = 0, curKeyLen = 0;

        for (Dimension dim : cuboid.getCuboidDimensions()) {
            String dimName = dim.getName();
            dimName2GroupKeyOffsetMap.put(dimName, curKeyLen);
            curKeyLen += dim.getKeyLen();
            if (groupDimensions.contains(dim.getName()))
                groupKeyLen = curKeyLen;
View Full Code Here

Examples of com.inadco.hbl.api.Cuboid

        Set<String> dimensionSubset = new HashSet<String>();
        dimensionSubset.addAll(dimSlices.keySet());
        dimensionSubset.addAll(groupDimensions);

        Cuboid cuboid = null;

        // find a suitable cuboid per above with fewest extra dimensions.
        for (Cuboid c : cube.getCuboids()) {

            List<String> cPath = c.getCuboidPath();
            // filter out smaller cubes
            if (cPath.size() < dimensionSubset.size())
                continue;

            // filter out those that don't contain all the dimensions we need
            if (!cPath.containsAll(dimensionSubset))
                continue;

            // now check group dimensions that must be stacked on the left.
            int cnt = groupDimensions.size();
            for (String dimName : cPath) {
                if (groupDimensions.contains(dimName)) {
                    cnt--;
                } else {
                    /*
                     * easy but still quite effective optimization is that if
                     * slices are degenerate, their dimension could be pushed
                     * left in the cuboid without breaking inline grouping
                     * prerequisites. This is surprisingly much more often the
                     * case as degenerate slicing is quite common.
                     */
                    List<Slice> slices = dimSlices.get(dimName);
                    if (slices == null || slices.size() != 1)
                        break; // clearly not degenerate

                    Slice slice = slices.get(0);
                    if (slice.isLeftOpen() || slice.isRightOpen()
                        || !slice.getLeftBound().equals(slice.getRightBound()))
                        break; // not degenerate.
                }
            }
            if (cnt > 0)
                continue;

            // found qualifying cuboid. good.
            if (cuboid == null || cPath.size() < cuboid.getCuboidPath().size())
                cuboid = c;
        }

        return cuboid;

View Full Code Here

Examples of com.inadco.hbl.api.Cuboid

        Validate.notNull(input, "input cannot be null");

        String cuboidPath = (String) input.get(0);
        Validate.notNull(cuboidPath, "path parameter can't be null");

        Cuboid c = path2CuboidMap.get(cuboidPath);
        Validate.notNull(c, "cuboid not found");

        DataBag db = new DefaultDataBag();

        byte[] key = new byte[c.getKeyLen()];
        walkDimensions(input, db, key, c.getCuboidDimensions(), 0, 0, TupleFactory.getInstance());

        return db;
    }
View Full Code Here

Examples of com.inadco.hbl.api.Cuboid

        dropTable();
        createTable();
    }

    private void insertTestData() throws IOException {
        Cuboid testCuboid = hblAdmin.getCube().findCuboidForPath(HblUtil.decodeCuboidPath("dim1/dim2"));
        Assert.notNull(testCuboid);

        byte[] key = new byte[testCuboid.getKeyLen()];
        for (long[] data : testData) {
            Dimension dim1 = testCuboid.getCuboidDimensions().get(0);
            Dimension dim2 = testCuboid.getCuboidDimensions().get(1);
        }
    }
View Full Code Here

Examples of resonant.lib.prefab.vector.Cuboid

  {
    Vector3 projectorPos = new Vector3((TileEntity) projector);
    projectorPos.add(projector.getTranslation());
    Vector3 relativePosition = position.clone().subtract(projectorPos);
    relativePosition.rotate(-projector.getRotationYaw(), -projector.getRotationPitch());
    Cuboid region = new Cuboid(projector.getNegativeScale().clone().scale(-1), projector.getPositiveScale());
    return region.intersects(relativePosition);
  }
View Full Code Here

Examples of resonant.lib.prefab.vector.Cuboid

  public boolean onProject(IProjector projector, Set<Vector3> fields)
  {
    final double repulsionVelocity = Math.max(projector.getModuleCount(this) / 20, 1.2);
    final Set<Vector3> field = projector.getCalculatedField();

    Cuboid volume = new Cuboid(projector.getNegativeScale().clone().invert(), projector.getPositiveScale().clone().add(1)).add(new Vector3((TileEntity) projector).add(projector.getTranslation()));
    List<Entity> entities = ((TileEntity) projector).getWorldObj().getEntitiesWithinAABB(Entity.class, volume.toAABB());

    for (Entity entity : entities)
    {
      Vector3 fieldPos = new Vector3(entity).floor();
View Full Code Here

Examples of resonant.lib.prefab.vector.Cuboid

    projectorPos.add(new Vector3(0, -negScale.intY() + 1, 0));

    Vector3 relativePosition = position.clone().subtract(projectorPos);
    relativePosition.rotate(-projector.getRotationYaw(), -projector.getRotationPitch());

    Cuboid region = new Cuboid(negScale.scale(-1), posScale);

    if (region.isIn(relativePosition) && relativePosition.y > 0)
    {
      if ((1 - (Math.abs(relativePosition.x) / xStretch) - (Math.abs(relativePosition.z) / zStretch) > relativePosition.y / yStretch))
      {
        return true;
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.