Commit c3f47078 authored by filatov's avatar filatov
Browse files

f_isLocationInsideRegion... (To be implemented)

Add mw_geographicRegion_rectangle
Remove mw_geographicRegion_rectangle_dummy
parent 78be1115
......@@ -866,6 +866,64 @@ module LibItsSecurity_Functions {
return valueof(p_parent) == valueof(p_region);
}
function f_isLocationInsideRegion(in template (value) GeographicRegion p_region,
in template (value) ThreeDLocation p_location
) return boolean {
var boolean v_ret := false;
select (p_region.region_type) {
case (e_none) {
v_ret := true;
}
case (e_circle) {
v_ret := f_isLocationInsideCircularRegion(p_region.region.circular_region, p_location);
}
case (e_rectangle) {
v_ret := f_isLocationInsideRectangularRegion(p_region.region.rectangular_region, p_location);
}
case (e_polygon) {
v_ret := f_isLocationInsidePolygonalRegion(p_region.region.polygonal_region, p_location);
}
case (e_id) {
v_ret := f_isLocationInsideIdentifiedRegion(p_region.region.id_region, p_location);
}
case else {
v_ret := f_isLocationInsideOtherRegion(p_region.region.other_region, p_location);
}
}
return v_ret;
}
function f_isLocationInsideCircularRegion(in template (value) CircularRegion p_region,
in template (value) ThreeDLocation p_location
) return boolean {
// TODO: distance between center and location must be less then radius
// Do not forget aboout passing throw 0 meridian
return true;
}
function f_isLocationInsideRectangularRegion(in template (value) RectangularRegions p_region,
in template (value) ThreeDLocation p_location
) return boolean {
// TODO: implement it
// Do not forget aboout passing throw 0 meridian
return true;
}
function f_isLocationInsidePolygonalRegion(in template (value) PolygonalRegion p_region,
in template (value) ThreeDLocation p_location
) return boolean {
// TODO: implement it
// Do not forget aboout passing throw 0 meridian
return true;
}
function f_isLocationInsideIdentifiedRegion(in template (value) IdentifiedRegion p_region,
in template (value) ThreeDLocation p_location
) return boolean {
// TODO: implement it
return true;
}
function f_isLocationInsideOtherRegion(in template (value) octetstring p_region,
in template (value) ThreeDLocation p_location
) return boolean {
return false;
}
} // End of group geometryFunctions
} // End of module LibItsSecurity_Functions
\ No newline at end of file
......@@ -178,6 +178,7 @@ module LibItsSecurity_Templates {
* @param p_southeast Lower rigth corner
* @see Draft ETSI TS 103 097 V1.1.6 Clause 4.2.21 GeographicRegion
*/
/*
template (present) GeographicRegion mw_geographicRegion_rectangle_dummy(
in template (present) TwoDLocation p_northwest,
in template (present) TwoDLocation p_southeast
......@@ -192,7 +193,7 @@ module LibItsSecurity_Templates {
} // End of field rectangular_region
} // End of field region
} // End of template mw_geographicRegion_rectangle_dummy
*/
} // End of group dummyBasicFormatElementsRecv
} // End of group dummyBasicFormatElements
......@@ -627,8 +628,8 @@ module LibItsSecurity_Templates {
* @see Draft ETSI TS 103 097 V1.1.6 Clause 4.2.21 GeographicRegion
*/
template (present) GeographicRegion mw_geographicRegion_circle(
in template (present) TwoDLocation p_center,
in template (present) UInt16 p_radius
in template (present) TwoDLocation p_center := ?,
in template (present) UInt16 p_radius := ?
) := {
region_type := e_circle,
region := {
......@@ -639,13 +640,34 @@ module LibItsSecurity_Templates {
} // End of field region
} // End of template mw_geographicRegion_circle
/**
* @desc Basic receive template rectangular geographic region
* @param p_northwest Upper left corner
* @param p_southeast Lower rigth corner
* @see Draft ETSI TS 103 097 V1.1.6 Clause 4.2.21 GeographicRegion
*/
template (present) GeographicRegion mw_geographicRegion_rectangle(
in template (present) TwoDLocation p_northwest := ?,
in template (present) TwoDLocation p_southeast := ?
) := {
region_type := e_rectangle,
region := {
rectangular_region := {
{
northwest := p_northwest,
southeast := p_southeast
}
} // End of field rectangular_region
} // End of field region
} // End of template mw_geographicRegion_rectangle_dummy
/**
* @desc Receive template polygonial geographic region
* @param p_polygonal_region Polygonial region description
* @see Draft ETSI TS 103 097 V1.1.6 Clause 4.2.21 GeographicRegion
*/
template (present) GeographicRegion mw_geographicRegion_polygonial(
in template (present) PolygonalRegion p_polygonal_region
in template (present) PolygonalRegion p_polygonal_region := ?
) := {
region_type := e_polygon,
region := {
......@@ -659,7 +681,7 @@ module LibItsSecurity_Templates {
* @see Draft ETSI TS 103 097 V1.1.6 Clause 4.2.21 GeographicRegion
*/
template (present) GeographicRegion mw_geographicRegion_identifiedRegion(
in template (present) IdentifiedRegion p_id_region
in template (present) IdentifiedRegion p_id_region := ?
) := {
region_type := e_id,
region := {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment