(*
 * $Id$
 *
 * JSDAI(TM), a way to implement STEP, ISO 10303
 * Copyright (C) 1997-2008, LKSoftWare GmbH, Germany
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License
 * version 3 as published by the Free Software Foundation (AGPL v3).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * JSDAI is a registered trademark of LKSoftWare GmbH, Germany
 * This software is also available under commercial licenses.
 * See also http://www.jsdai.net/
 *)

(*
Derived from ISO TC184/SC4/WG12 N2690 - ISO/TS 10303-1001 Appearance assignment - EXPRESS ARM
by LKSoftWare GmbH for implementation purpose within IDA-STEP(TM)
*) 


SCHEMA Appearance_assignment_xim;

USE FROM Elemental_geometric_shape_xim;    -- ISO/TS 10303-1004

USE FROM Foundation_representation_xim;    -- ISO/TS 10303-1006

USE FROM aic_associative_draughting_elements(draughting_model);

USE FROM aic_mechanical_design_geometric_presentation(mechanical_design_geometric_presentation_representation);

USE FROM presentation_appearance_schema(
	presentation_style_assignment,
	presentation_style_select,
	presentation_style_by_context,
	over_riding_styled_item,
	style_context_select,
	styled_item);

USE FROM representation_schema(
  mapped_item,
  representation_map);

(*
TYPE appearance_context = EXTENSIBLE GENERIC_ENTITY SELECT;
END_TYPE; 

TYPE appearance_select = EXTENSIBLE GENERIC_ENTITY SELECT;
END_TYPE; 

--This select is created for entities which were pointing to ARM entity Styled_model, which is now splitted into 2 entities 
TYPE styled_model = SELECT
	(Styled_model__draughting_model,
	Styled_model__mechanical_design_geometric_presentation_representation);
END_TYPE; 

TYPE styled_model_element_select = SELECT
   (Mapping_based_styled_model, 
    Styled_element, 
    Transformation_based_styled_model);
END_TYPE; 

ENTITY Appearance_assignment
  SUBTYPE OF (presentation_style_assignment);
  SELF\presentation_style_assignment.styles RENAMED appearance_components : SET[1:?] OF presentation_style_select;
END_ENTITY;

ENTITY Context_dependent_appearance_assignment
  SUBTYPE OF (Appearance_assignment, presentation_style_by_context);
  SELF\presentation_style_by_context.style_context RENAMED context_definition : style_context_select;
END_ENTITY;

ENTITY Mapping_based_styled_model
  SUBTYPE OF (Representation_item, mapped_item);
  replicated_model : Styled_model;
  source : axis2_placement;
  target : geometric_mapping_target;
DERIVE
  SELF\mapped_item.mapping_target : representation_item := ?;
  SELF\mapped_item.mapping_source : representation_map := ?;
END_ENTITY;

ENTITY Over_riding_styled_element
  SUBTYPE OF (Styled_element, over_riding_styled_item);
  SELF\over_riding_styled_item.over_ridden_style RENAMED over_ridden_element : styled_item;
END_ENTITY;

ENTITY Styled_element
  ABSTRACT SUPERTYPE 
  SUBTYPE OF (Representation_item, styled_item);
  appearance : Appearance_assignment;
  invisible : BOOLEAN;
DERIVE
  SELF\styled_item.item : representation_item := ?;
  SELF\styled_item.styles : SET [1:?] OF presentation_style_assignment := ?;
END_ENTITY;

ENTITY Styled_geometric_model__draughting_model
  SUBTYPE OF (Styled_model__draughting_model);
  styled_geometry : shape_representation;
DERIVE
  SELF\Representation.context_of_items : Representation_context := styled_geometry\Representation.context_of_items;
END_ENTITY;

ENTITY Styled_geometric_model__mechanical_design_geometric_presentation_representation
  SUBTYPE OF (Styled_model__mechanical_design_geometric_presentation_representation);
  styled_geometry : shape_representation;
DERIVE
  SELF\Representation.context_of_items : Representation_context := styled_geometry\Representation.context_of_items;
END_ENTITY;

ENTITY Styled_model__draughting_model
  SUBTYPE OF (draughting_model);
  version_id : OPTIONAL STRING;
  SELF\Representation.items : SET[1:?] OF styled_model_element_select;
END_ENTITY;

ENTITY Styled_model__mechanical_design_geometric_presentation_representation
  SUBTYPE OF (mechanical_design_geometric_presentation_representation);
  version_id : OPTIONAL STRING;
  SELF\Representation.items : SET[1:?] OF styled_model_element_select;
END_ENTITY;

ENTITY Styled_model_element
  SUBTYPE OF (Styled_element);
  SELF\styled_item.item RENAMED element : representation_item;
END_ENTITY;

ENTITY Transformation_based_styled_model
  SUBTYPE OF (Representation_item, mapped_item);
  replicated_model : Styled_model;
  SELF\mapped_item.mapping_target RENAMED replication_transformation : cartesian_transformation_operator;
DERIVE
  SELF\mapped_item.mapping_source : representation_map := ?;
END_ENTITY;
*)
END_SCHEMA;  -- Appearance_assignment_arm
