org.citygml4j.model.citygml.appearance.AppearanceMember Java Examples

The following examples show how to use org.citygml4j.model.citygml.appearance.AppearanceMember. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Appearance100Marshaller.java    From citygml4j with Apache License 2.0 6 votes vote down vote up
private TypeMapper<JAXBElement<?>> getElementMapper() {
	if (elementMapper == null) {
		lock.lock();
		try {
			if (elementMapper == null) {
				elementMapper = TypeMapper.<JAXBElement<?>>create()
						.with(AppearanceMember.class, this::createAppearanceMember)
						.with(GeoreferencedTexture.class, this::createGeoreferencedTexture)
						.with(ParameterizedTexture.class, this::createParameterizedTexture)
						.with(TexCoordGen.class, this::createTexCoordGen)
						.with(TexCoordList.class, this::createTexCoordList)
						.with(X3DMaterial.class, this::createX3DMaterial);
			}
		} finally {
			lock.unlock();
		}
	}

	return elementMapper;
}
 
Example #2
Source File: Appearance200Marshaller.java    From citygml4j with Apache License 2.0 6 votes vote down vote up
private TypeMapper<JAXBElement<?>> getElementMapper() {
	if (elementMapper == null) {
		lock.lock();
		try {
			if (elementMapper == null) {
				elementMapper = TypeMapper.<JAXBElement<?>>create()
						.with(Appearance.class, this::createAppearance)
						.with(AppearanceMember.class, this::createAppearanceMember)
						.with(GeoreferencedTexture.class, this::createGeoreferencedTexture)
						.with(ParameterizedTexture.class, this::createParameterizedTexture)
						.with(TexCoordGen.class, this::createTexCoordGen)
						.with(TexCoordList.class, this::createTexCoordList)
						.with(X3DMaterial.class, this::createX3DMaterial);
			}
		} finally {
			lock.unlock();
		}
	}

	return elementMapper;
}
 
Example #3
Source File: CoreUnmarshaller.java    From citygml4j with Apache License 2.0 6 votes vote down vote up
public List<AppearanceMember> getGlobalAppearances() {
	List<AppearanceMember> result;

	if (hasGlobalAppearances()) {
		result = appearanceContainer.getAppearance().stream()
				.map(AppearanceProperty::getAppearance)
				.map(AppearanceMember::new)
				.collect(Collectors.toList());

		templates = null;
		templateInfos = null;
		appearanceContainer = null;
	} else
		result = Collections.emptyList();

	return result;
}
 
Example #4
Source File: GMLFunctionWalker.java    From citygml4j with Apache License 2.0 5 votes vote down vote up
public T apply(CityModel cityModel) {
	T object = apply((AbstractFeatureCollection)cityModel);
	if (object != null)
		return object;

	if (cityModel.isSetCityObjectMember()) {
		for (CityObjectMember cityObjectMember : new ArrayList<CityObjectMember>(cityModel.getCityObjectMember())) {
			object = apply(cityObjectMember);
			if (object != null)
				return object;
		}
	}

	if (cityModel.isSetAppearanceMember()) {
		for (AppearanceMember appearanceMember : new ArrayList<AppearanceMember>(cityModel.getAppearanceMember())) {
			object = apply(appearanceMember);
			if (object != null)
				return object;
		}
	}

	if (cityModel.isSetGenericApplicationPropertyOfCityModel()) {
		for (ADEComponent ade : new ArrayList<ADEComponent>(cityModel.getGenericApplicationPropertyOfCityModel())) {
			object = apply(ade);
			if (object != null)
				return object;
		}
	}

	return null;
}
 
Example #5
Source File: FeatureFunctionWalker.java    From citygml4j with Apache License 2.0 5 votes vote down vote up
public T apply(CityModel cityModel) {
	T object = apply((AbstractFeatureCollection)cityModel);
	if (object != null)
		return object;

	if (cityModel.isSetCityObjectMember()) {
		for (CityObjectMember cityObjectMember : new ArrayList<CityObjectMember>(cityModel.getCityObjectMember())) {
			object = apply(cityObjectMember);
			if (object != null)
				return object;
		}
	}

	if (cityModel.isSetAppearanceMember()) {
		for (AppearanceMember appearanceMember : new ArrayList<AppearanceMember>(cityModel.getAppearanceMember())) {
			object = apply(appearanceMember);
			if (object != null)
				return object;
		}
	}

	if (cityModel.isSetGenericApplicationPropertyOfCityModel()) {
		for (ADEComponent ade : new ArrayList<ADEComponent>(cityModel.getGenericApplicationPropertyOfCityModel())) {
			object = apply(ade);
			if (object != null)
				return object;
		}
	}

	return null;
}
 
Example #6
Source File: Appearance100Marshaller.java    From citygml4j with Apache License 2.0 5 votes vote down vote up
private TypeMapper<Object> getTypeMapper() {
	if (typeMapper == null) {
		lock.lock();
		try {
			if (typeMapper == null) {
				typeMapper = TypeMapper.create()
						.with(Appearance.class, this::marshalAppearance)
						.with(AppearanceMember.class, this::marshalAppearanceProperty)
						.with(AppearanceProperty.class, this::marshalAppearanceProperty)
						.with(GeoreferencedTexture.class, this::marshalGeoreferencedTexture)
						.with(ParameterizedTexture.class, this::marshalParameterizedTexture)
						.with(SurfaceDataProperty.class, this::marshalSurfaceDataProperty)
						.with(TexCoordGen.class, this::marshalTexCoordGen)
						.with(TexCoordList.class, this::marshalTexCoordList)
						.with(TextureAssociation.class, this::marshalTextureAssociation)
						.with(TextureCoordinates.class, this::marshalTextureCoordinates)
						.with(TextureType.class, this::marshalTextureType)
						.with(WorldToTexture.class, this::marshalWorldToTexture)
						.with(WrapMode.class, this::marshalWrapMode)
						.with(X3DMaterial.class, this::marshalX3DMaterial);
			}
		} finally {
			lock.unlock();
		}
	}

	return typeMapper;
}
 
Example #7
Source File: Appearance200Marshaller.java    From citygml4j with Apache License 2.0 5 votes vote down vote up
private TypeMapper<Object> getTypeMapper() {
	if (typeMapper == null) {
		lock.lock();
		try {
			if (typeMapper == null) {
				typeMapper = TypeMapper.create()
						.with(Appearance.class, this::marshalAppearance)
						.with(AppearanceMember.class, this::marshalAppearanceMember)
						.with(AppearanceProperty.class, this::marshalAppearanceProperty)
						.with(GeoreferencedTexture.class, this::marshalGeoreferencedTexture)
						.with(ParameterizedTexture.class, this::marshalParameterizedTexture)
						.with(SurfaceDataProperty.class, this::marshalSurfaceDataProperty)
						.with(TexCoordGen.class, this::marshalTexCoordGen)
						.with(TexCoordList.class, this::marshalTexCoordList)
						.with(TextureAssociation.class, this::marshalTextureAssociation)
						.with(TextureCoordinates.class, this::marshalTextureCoordinates)
						.with(TextureType.class, this::marshalTextureType)
						.with(WorldToTexture.class, this::marshalWorldToTexture)
						.with(WrapMode.class, this::marshalWrapMode)
						.with(X3DMaterial.class, this::marshalX3DMaterial);
			}
		} finally {
			lock.unlock();
		}
	}

	return typeMapper;
}
 
Example #8
Source File: Appearance200Unmarshaller.java    From citygml4j with Apache License 2.0 5 votes vote down vote up
public AppearanceMember unmarshalAppearanceMember(FeaturePropertyType src) throws MissingADESchemaException {
	AppearanceMember dest = new AppearanceMember();
	jaxb.getGMLUnmarshaller().unmarshalFeatureProperty(src, dest);

	if (src.isSet_Feature()) {
		ModelObject abstractFeature = jaxb.unmarshal(src.get_Feature());
		if (abstractFeature instanceof Appearance)
			dest.setAppearance((Appearance)abstractFeature);
	}

	return dest;
}
 
Example #9
Source File: CityModel.java    From citygml4j with Apache License 2.0 4 votes vote down vote up
public void addAppearanceMember(AppearanceMember appearanceMember) {
	getAppearanceMember().add(appearanceMember);
}
 
Example #10
Source File: CityModel.java    From citygml4j with Apache License 2.0 4 votes vote down vote up
public List<AppearanceMember> getAppearanceMember() {
	if (appearanceMember == null)
		appearanceMember = new ChildList<>(this);

	return appearanceMember;
}
 
Example #11
Source File: CityModel.java    From citygml4j with Apache License 2.0 4 votes vote down vote up
public void setAppearanceMember(List<AppearanceMember> appearanceMember) {
	this.appearanceMember = new ChildList<>(this, appearanceMember);
}
 
Example #12
Source File: CityModel.java    From citygml4j with Apache License 2.0 4 votes vote down vote up
public boolean unsetAppearanceMember(AppearanceMember appearanceMember) {
	return isSetAppearanceMember() && this.appearanceMember.remove(appearanceMember);
}
 
Example #13
Source File: Appearance200Marshaller.java    From citygml4j with Apache License 2.0 4 votes vote down vote up
public FeaturePropertyType marshalAppearanceMember(AppearanceMember src) {
	return jaxb.getGMLMarshaller().marshalFeatureProperty(src);
}
 
Example #14
Source File: Appearance200Marshaller.java    From citygml4j with Apache License 2.0 4 votes vote down vote up
private JAXBElement<?> createAppearanceMember(AppearanceMember src) {
	return app.createAppearanceMember(marshalAppearanceMember(src));
}
 
Example #15
Source File: Appearance100Unmarshaller.java    From citygml4j with Apache License 2.0 4 votes vote down vote up
public AppearanceMember unmarshalAppearanceMember(AppearancePropertyType src) throws MissingADESchemaException {
	AppearanceMember dest = new AppearanceMember();
	unmarshalAppearanceProperty(src, dest);

	return dest;
}