public ChatConfigResource(Item configItem) { //myURI_Fragment = configItem.getIdent().getLocalName(); List<Item> entryItems = reader.readLinkedItemSeq(configItem, ChatAN.P_entry); theLogger.info("Number of entries found: {}", entryItems.size()); for (Item ei : entryItems) { String name = ItemFuncs.getString(ei, ChatAN.P_name, null); String url = ItemFuncs.getString(ei, ChatAN.P_url, ""); if (name != null) { entries.put(name, url); } else { theLogger.warn("Found an entry with no listed name key in chat config resource"); } } } }
public static BoneProjectionRange makeOne(BoneJointConfig bjc, Item configItem) { String boneName = ItemFuncs.getString(configItem, BoneAN.P_boneName, null); String rotAxisName = ItemFuncs.getString(configItem, BoneAN.P_rotationAxis, null); Double minAngDeg = ItemFuncs.getDouble(configItem, BoneAN.P_minAngleDeg, null); Double maxAngDeg = ItemFuncs.getDouble(configItem, BoneAN.P_maxAngleDeg, null); double minAngRad = Math.toRadians(minAngDeg); double maxAngRad = Math.toRadians(maxAngDeg); BoneRotationAxis rax = BoneRotationAxis.valueOf(rotAxisName); BoneProjectionRange bpr = new BoneProjectionRange(bjc, boneName, rax, minAngRad, maxAngRad); return bpr; } public String getBoneName() {
@Override protected void initExtendedFieldsAndLinks(BoneRobotConfig mrc, Item configItem, Assembler assmblr, Mode mode) { getLogger().debug("BoneRobotConfig.initExtendedFieldsAndLinks()-BEGIN"); mrc.myRobotName = ItemFuncs.getString(configItem, BoneAN.P_robotName, null); Set<Item> jointItems = ItemFuncs.getLinkedItemSet(configItem, BoneAN.P_joint); for (Item ji : jointItems) { BoneJointConfig bjc = new BoneJointConfig(ji); mrc.myBJCs.add(bjc); } Collections.sort(mrc.myBJCs, new Comparator() { public int compare(Object o1, Object o2) { int jointNum1 = ((BoneJointConfig) o1).myJointNum; int jointNum2 = ((BoneJointConfig) o2).myJointNum; return jointNum1 - jointNum2; } }); }
public LightConfig(Item configItem) { lightName = configItem.getIdent().getLocalName(); lightType = LightType.AMBIENT; // For now, we assume light is ambient (no direction required) if type is not specified String typeString = ItemFuncs.getString(configItem, LightsCameraAN.P_lightType, null); if (typeString.equals("DIRECTIONAL")) { lightType = LightType.DIRECTIONAL; } for (int index = 0; index < lightDirection.length; index++) { lightDirection[index] = ItemFuncs.getDouble(configItem, LightsCameraAN.P_direction[index], 0.0).floatValue(); } for (int index = 0; index < lightColor.length; index++) { lightColor[index] = ItemFuncs.getDouble(configItem, LightsCameraAN.P_color[index], null).floatValue(); } }
public BoneJointConfig(Item configItem) { myURI_Fragment = configItem.getIdent().getLocalName(); myJointNum = ItemFuncs.getInteger(configItem, BoneAN.P_jointNum, null); myJointName = ItemFuncs.getString(configItem, BoneAN.P_jointName, null); myNormalDefaultPos = ItemFuncs.getDouble(configItem, BoneAN.P_defaultPosNorm, null); Set<Item> bprItems = ItemFuncs.getLinkedItemSet(configItem, BoneAN.P_projectionRange); for (Item bpri : bprItems) { BoneProjectionRange bpr = BoneProjectionRange.makeOne(this, bpri); myProjectionRanges.add(bpr); } }