--============================
-- Make a new module Camera_view containing Model_image, Clipping_region
SCHEMA Camera_view_mim;

USE FROM Presentation_hierarchy_mim;

USE FROM Value_with_unit_mim;

USE FROM presentation_organization_schema    --  ISO 10303-46
  (camera_image, 
   camera_model_d2,
   camera_model_d3,
   view_volume);

USE FROM presentation_resource_schema
  (planar_extent); 

REFERENCE FROM presentation_organization_schema    -- ISO 10303-46
  (aspect_ratio);

ENTITY camera_image_2d_with_scale
  SUBTYPE OF (camera_image);
DERIVE
  scale : positive_ratio_measure := (SELF\mapped_item.mapping_target\planar_extent.size_in_x);
WHERE
  WR1: ('ANNOTATED_PRESENTATION.CAMERA_MODEL_D2' IN TYPEOF(SELF\mapped_item.mapping_source.mapping_origin));
  WR2: aspect_ratio (SELF\mapped_item.mapping_target) = aspect_ratio (SELF\mapped_item.mapping_source.mapping_origin\camera_model_d2.view_window);
  WR3: SELF\mapped_item.mapping_source.mapping_origin\camera_model_d2.view_window_clipping;
END_ENTITY;

END_SCHEMA;
