Maps of Romania
Satellite maps of Romania by using the Google Maps facility
<HEAD>
.................
<script src="http://maps.google.com/maps?file=api&v=2&key=.....//Your key from Google here http://code.google.com/apis/maps
type="text/javascript"></script>
<SCRIPT type=text/javascript>
//<![CDATA[
function load() {
if (GBrowserIsCompatible())
{
var map = new GMap2(document.getElementById("map"));
map.setCenter(new GLatLng(46.756, 23.647), 6,G_HYBRID_TYPE);
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
var point = new GLatLng(46.756, 23.647);
var marker = new GMarker(point);
GEvent.addListener(
marker, "click",
function() {
var content = "<h1>Cluj-Napoca, Romania</h1><p>Largest town of Transylvania</p><p> 46,756ºN ; 23,647ºE </p>";
content +="<p> </p>";
content +="<p><b>Our links: </b></p>";
content += " <p><a href='http://www.academic.ro'>academic.ro</a> </p>";
content += " <p><a href='http://lichens.duci.ro'>'Lichens from Romania' portal</a> </p>";
content +="<p> </p>";
marker.openInfoWindowHtml(content);
}
);
map.addOverlay(marker);
var map1 = new GMap2(document.getElementById("map1"));
map1.setCenter(new GLatLng(46.756, 24.647), 5,G_MAP_TYPE);
map1.addControl(new GSmallMapControl());
}
}
//]]>
</SCRIPT>
.............
</HEAD>
<BODY onload="load()" onunload="GUnload()">
........................
<table width="200" border="0" align="center">
<tr>
<td><DIV id=map style="OVERFLOW: hidden; WIDTH: 800px; HEIGHT: 600px"></DIV> </td>
<td><div align="center"></div>
<DIV id=map1 style="OVERFLOW: hidden; WIDTH: 250px; HEIGHT: 600px"></DIV></td>
</tr>
</table>
...........................
</BODY>

Hydrologic map of Romania
I. Area of the high Carpathians. It includes the highest parts of the Southern Carpathians and the Northern part of Eastern Carpathians. In terms of complex natural environment, is the lower part of the alpine area, maximum altitude around 2500 meters, the annual water flow: 1000 - 1400 mm(Predominantly from snow melting and rain in summer). |
|
|
I 1 = (Massif Retezat-Hunedoara County) Peak 'Peleaga': 2509 m. alt., Peak 'Papusa': 2508 m. alt., Peak 'Retezat': 2482 m. alt., Peak 'Bucura': 2433 m. 'Retezat' National Park: 2074 m alt. |
|
I2= (Parang Mountains): Gorj County Peak 'Papusa': 2136 m. alt., Hunedoara County: Peak 'Parângul Mare': 2519 m alt., 'Cârja' Peak: 2405 m . alt."> |
|
I 3 = (Fagaras Mountains): Arges County: Peak 'Valea Lunga': 2254.m. alt., 'Lespezile': 1908 m.alt., Brasov County Peak 'Moldoveanul': 2544 m. alt., Sibiu County Peak 'Negoiul': 2535 m. alt., County Valcea and Sibiu County border with Peak 'Grohotisul': 2366 m. alt. |
|
I 4 = (Bucegi Mountains) Peak 'Omul': 2505 m. alt. (limit of Brasov county, Dambovita and Prahova) Brasov County Peak 'Varful Bucsoiului', 'Poiana Morarului', 'Poiana batranilor', 'Diham', 'Valea Boiului', "Valea Malaesti', Dambovita County: 'Cheile Zanoaga', 'Cheile Orzii','Cheile Tatarului', 'Cheile Ialomitei'; Prahova county: 'Poiana Izvorului', 'Gura Dihamului', 'Costila', 'Valea Cerbului', 'Vârful Caraiman', 'Piatra Arsa', 'Furnica', 'Vârful cu Dor', 'Babele', 'Brâul Mare al jepilor', 'Poiana Tapului', 'Izvorul Rece', 'Bucsoiu', 'Muntele Gâlma', 'Muntii Baiului': 'Vârful Neamtului', 'Vârful Câinelui' |
|
I 5 = (Rodna Massif) Peak 'Batrana' (border of Bistrita-Nasaud county and Maramures county), Bistrita-Nasaud County: 'Ineu' Peak (2279 m alt.), 'Vârful Tapului', 'Muntele Paltin', 'Muntele Corongis', 'Rodna Veche', 'Valea Vinului', 'Valea Rebra'; jud. Maramures: peak 'Pietrosul': (2303 m alt.). |
|
II = Middle height zone of the Southern Carpathians. It has similar features with zone I but here we meet the elements of the Mediterranean hydrological regime, floods in winter due to frequent air heating. Areal includes: Arges County: Mountains 'Iezerului', Brasov County: Mount 'Postavarul', Mount 'Piatra Mare', 'Piatra Craiului' Mountains, 'Persani' Mountains, Depression of 'Brasov'; 'Siriu' mountains, 'Ivanet' Mountain, 'Podul Calului' Mountain,'Penteleu' Mountain, Buzau Subcarpathian hills; Dâmbovita ounty: 'Leaota' Mountains, Prahova subcarpathian hills; Gorj County: 'Vâlcanului' Mountains, Gorj subcarpathian hills, 'Târgu- Jiu' Depression, 'Carbunesti' Depression; Hunedoara County: 'Sureanu' Mountains, Petrosani depression, 'Orastie' Valley ; Prahova County: 'Ciucas' Mountains, 'Grohotis' Mountains, 'Valea Doftanei', 'Muntii Baiului', Prahova subcarpathian hills; Sibiu County: 'Cândelului (Cibinului)' Mountains, Sibiu depression; Vâlcea county: 'Capatâna' Mountains, 'Lotru' Mountains, 'Cozia' Mountains, Vâlcea subcarpathians hills |
|
III = area of Eastern and Western Carpathian Transylvania: is characterized by a rich supply of river water from rain, high water runoff, including the 'Apuseni' Mountains(western Carpathians) and west of the Eastern Carpathians |
|
III 1 = The western part of Eastern Carpathians; Bistrita-Nasaud County: 'Bargaului' mountains, Covasna County: Mountains 'INTORSURII', 'Bodoc' Mountains, 'Baraolt' mountains; Harghita County: 'Harghita' Mountains, 'Ciuc' basin, Mount 'Giurgeu' , 'Ciuc' Mountains, 'Maramures' County: Mountains 'Ignis', depression 'Maramures', Mountains 'Maramures'; Mures County: Mountains 'Calimani', Mt. 'Gurghiului', Transylvania subcarpathian hills; Satu Mare County: 'Oas' Mountains, 'Oas' Plateau. |
|
III 2 = Apuseni Mountains: Alba County: Mountains 'Trascaului', depression 'Campeni'; Arad County: Arad, depression 'Zarand'; Bihor County: 'Padurea Craiului' Mountains, 'Bihor' Mountains, 'Codru-Moma'; Cluj County: Massif ;Vladeasa; ;Gilau;-Mount High Mountains; Hunedoara County: Depression 'Brad-Halmagiu', 'Metaliferi' Mountains; Salaj County: 'Mese's Mountains. |
|
IV = Area east of the Eastern Carpathians. Water feed of rivers through intense storms, the prevalence of high water during spring and frequent floods during the summer and sometimes during fall; due to intensive groundwater supply, there is water feed even during drought. Areal includes: Bacau County: 'Nemirei' Mountains, 'Pietricica' peak, 'Ciuc' Mountains, 'Berzunti' mountains, depression 'Tazlau', Moldova subcarpatian hills; Neamt County: Mountains 'Tarcaia', 'Gosman' Mountains, Peak and Mountain 'Ceahlau', Mountains 'Stânisoara', Moldova subcarpathian hills; Suceava County: 'Obcina Brodinei'; Suceava County: 'Suceava' Plateau, Plateau 'Radauti', Plateau 'Dragomirna', corridor 'Siret', 'Suhard', 'Dorna' Depression, 'Obcina Mestecanisului', 'Obcina Feredeului', Mount 'Giumalau', Mount 'Rarau'; Vrancea County: ;Vrancea; Mountains, Vrancea subcarpathian hills. |
|
V= Carpathian and Subcarpathian area in northwestern Oltenia. It is characterized by frequent air heating in winter, which yields higher water flow than in the summer. areal includes: Mehedinti County: 'Mehedinti' Plateau, 'Mehedinti' Mountains, 'Almajului' mountains. |
|
VI = Banat Mountains area. Has much in common with zone V, but floods in winter resulting from rainfall, are more frequent in this area and better reflect the features of the Mediterranean hydrological regime, high underground water feed, numerous carstic springs . Areal includes: Caras-Severin Counties, 'Cerna' Mountains, depression 'Caransebes', 'Semenic' 'Anina' Mountains, 'Docnecei' mountain, 'Locvei', 'Anina' Mountains, depression 'Almajului'. |
|
VII = Southern piemontal hills area. It is characterized by high water feed due to spring and floods in winter and summer, is distinguished from other areas by varying conditions of supply of underground waters that are related to the particular geological structure and deep river valleys, most of the river dry both in summer and winter. Areal includes: Arges County: 'Muscelele Argesului', 'Piemontul Cotmenei', 'Gruiurile Argesului', 'Piemontul Cândesti'; Dâmbovita County: 'Piemontul Cândesti'; Gorj county: 'Gruiurile Jiului'; Mehedinti county: 'Piemontul Motrului', 'Balacita' plateau; Olt county: 'Piemontul Cotmenei'; Vâlcea county: 'Piemontul Oltetului' |
|
VIII = Moldova Plateau area. Continental hydrological regime is more marked than in other areas, expressed through floods and heavy rain in summer and autumn. Areal includes: Bacau County: 'Tutova' Hills, hills 'Falciu'; Botosani county: Plain ;Moldova'; Galati County: Plain 'Tecuci', Plain 'Covârlui', Plateau 'Covârlui'; Iasi County: 'Dealul Mare' hill, Plain 'Moldova', the Moldavian Central Plateau, 'Tutova' Hills; Suceava County: 'Suceava' Plateau; Vaslui County: Central Moldavian Plateau, 'Tutova' Hills, hills 'Falciu'; Vrancea County: Hills 'Susita', 'Tutova' Hills, 'Hills' Milcovului. |
|
IX = Romanian Plain and Dobrogea area: hydrological regime of unstable rivers with floods of rain throughout the year and high water from snow melt only;contribution of underground waters is rather weak in feeding rivers; predominant water feed through snow and rain: |
|
IX 1 = 'Romanin' Plain. Areal includes: County Braila: 'Braila' Plain, Lower Siret Plain, 'Balta Brailei'; Buzau County: Plain 'Râmnic'; Dambovita County: Plain 'Targoviste-Ploiesti', Plain 'Titu'; Dolj County: 'Oltenia' Plain, Plain 'Desnatuiului', Danube Meadow; Ialomita county: 'Baraganul Ialomitei', 'Balta Ialomitei'; Ilfov County: Plain 'Vlasiei', Plain 'Mostistea'; Mehedinti County: Plain 'Blahnita'; Olt county: 'Boian' Plain; Prahova County: 'Câmpia Saratei'; County Teleorman: Plain 'Gavanu-Burda', 'Boian' Plain. |
|
IX 2 = Dobrogea. Areal includes: Constanta County: South Dobrogea Plateau, Plateau 'Casimcea'; Tulcea County: 'Macin' Mountains ('Pricopan' summit: 370 m alt), Plateau 'Niculitel', 'Tulcea' Hills, North Dobrogea Plateau, Plateau 'Babadag'. |
|
X = Western piemont hills and the Tisza Plain. Hydrological regime of rivers is characterized by floods due to snow/ice melt or rain in winter, rain floods in summer and autumn while groundwater has little contribution in feeding rivers. Areal includes: Arad County: 'Mures Plain', Plateau 'Lipova'; Bihor County: Hills 'Tasad', 'Cris' Plain, Hills 'Oradea'; Caras-Severin county: 'Caras' Depression, 'Oravitei' Hills, Hills 'Poganis'; Satu Mare County: Plain of Somes; County Timis: 'Timis' Plain, 'Bârzava' Plain, 'Buzias' hills, 'Vinga' plain, 'Aranca' plain. |
|
XI = Transylvanian Basin area. Water feed is characterized by high water and floods in spring and eventually high waters in summer and fall while feeding by underground rivers is reduced. Areal includes: Alba County: Plateau 'Secaselor'; Bistrita-Nasaud County: Transylvanian Plain, 'Bistrita' Hills, Hills 'Nasaud'; Brasov County: 'Fagaras' Depression; Cluj County: Transylvanian Plain, Plain 'Fizes', 'Somes' Plateau, hills 'Feleacu'; Maramures County: Hills 'Chioaru'; Mures County: Hills 'Târnavei Mici', 'Sarmasului' Plain, Plateau 'Tarnavelor'; Mures County: Plain 'Sarmasului', Plateau 'Tarnavelor'; Salaj County: 'Somes' Plateau, Plateau 'Boiului', Hills 'Salaj'; Sibiu County: Plateau 'Tarnavelor', Plateau 'Hârtibaciu'. |
|
Programmable maps of Romania by using the DISLIN package
Most of the code used below is adapted from the examples by
Helmut Michels, author of the DISLIN plotting package



-
FORTRAN code for use with ProgrammingPool
PARAMETER (N = 32)
DIMENSION INRAY(N),IPRAY(N),ICRAY(N)
DO I=1,N
INRAY(I)=I
IPRAY(I)=0
ICRAY(I)=1
END DO
CALL METAFL ('png')
CALL SETPAG ('DA4L')
CALL SCRMOD ('REVERS')
CALL DISINI
CALL PAGERA
CALL COMPLX
CALL INTAX
CALL TICKS(1,'XY')
C CALL FRAME(3)
CALL AXSLEN(1600,2200)
CALL AXSPOS(400,2700)
CALL NAME('Longitudine','X')
CALL NAME('Latitudine','Y')
CALL TITLIN('Proiectie cilindrica echidistanta',3)
c CALL LABELS('MAP','XY')
CALL PROJCT('CYLI')
CALL GRAFMP(20.,30.,20.,1.0,43.5,48.5,44.0,1.0)
CALL GRIDMP(2,2)
CALL SHDEUR(25,0,12,1)
C (INRAY,IPRAY,ICRAY,N)
CALL HEIGHT(50)
CALL TITLE
CALL DISFIN
END


-
FORTRAN code for use with ProgrammingPool
CALL METAFL ('XWIN')
CALL SETPAG('DA4L')
CALL DISINI
CALL PAGERA
CALL COMPLX
CALL FRAME(3)
CALL AXSPOS(400,1850)
CALL AXSLEN(2400,1400)
CALL NAME('Longitude','X')
CALL NAME('Latitude','Y')
CALL TITLIN('World Coastlines and Lakes',3)
CALL LABELS('MAP','XY')
CALL GRAFMP(-180.,180.,-180.,90.,-90.,90.,-90.,30.)
CALL GRIDMP(1,1)
CALL WORLD
CALL HEIGHT(50)
CALL TITLE
CALL DISFIN
END



-
FORTRAN code for use with ProgrammingPool
PARAMETER (N =32)
DIMENSION INRAY(1),IPRAY(1),ICRAY(1)
I=1
DO I=1,N
INRAY(I)=I
IPRAY(I)=I
ICRAY(1)= I/2
END DO
CALL METAFL ('XWIN')
CALL SETPAG ('DA4L')
CALL DISINI
CALL PAGERA
CALL COMPLX
CALL INTAX
CALL TICKS (1,'XY')
CALL FRAME (3)
CALL AXSLEN (1600,2200)
CALL AXSPOS (400,2700)
CALL NAME ('Longitude','X')
CALL NAME ('Latitude','Y')
CALL TITLIN ('Conformal Conic Projection',3)
CALL LABELS ('MAP','XY')
CALL PROJCT ('CONF')
CALL GRAFMP (-10.,30.,-10.,5.,35.,70.,35.,5.)
CALL GRIDMP (1,1)
CALL SHDEUR (INRAY,IPRAY,ICRAY,N)
CALL HEIGHT (50)
CALL TITLE
CALL DISFIN
END

An interactive program to plot Romania maps by using the DISLIN package and WinAPI32
Download program

Program functionality
The program plots the map of Romania and adds interactively marks and labels to the geographical coordinates of an item such as a locality.
The plotting is done by using the DISLIN package while frindly Open/Save and data editing is made in the frame of WinAPI32 instructions by using our ProgrammingPool environment. The files bdta1.dat and bdta2.dat must be saved in the folder c:\dislin\map\
-
In the upper window(work window) the user should write in separate rows:
1. Number of points - i.e. items such as localities - which will be plotted = N
2. N rows containing: LONGITUDE, LATITUDE folowed by the label, i.e. name of the locality
-
Program functionality is obtained by clicking the menu items or by using keyboard shortcuts in the usual way:
 |
<Alt>L for data Load |
 |
<Alt>S for Saving data |
 |
<Alt>P for data Plot |
 |
<Alt>H for Help |
 |
<Alt>A for About |
 |
<Alt>V for Image saving |
 |
<Alt>E for Ending program |
-
The work window (the upper window) is automatically saved as 'map_ro.in' - a text file, in the working folder, identified during saving the data.
-
To end visualization click the mouse right button.
-
You may save the image in TIFF format but keeping keep in mind the current working folder == WHERE YOU SAVED THE INPUT DATA == a mandatory requirement for a clean work
-
In case of name repetition in the same folder, the old file is not overwritten but a counter is attached to the first few characters of the file name.
-
After the plot the data used in 'map_ro.in' are posted in the lower window. Similarly, after saving the image, the path is posted in the lower window for verification.
Listing of the program written in C++ as ran with ProgrammingPool
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <dislin.h>
#include<g++/streambuf.h>
#pragma hdrstop
#include<g++/iostream.h>
#include<math.h>
#define CM_HELP 9061
#define CM_ABOUT 9062
#define CM_CALCUL 9063
#define CM_SAVEAS 9072
#define CM_OPEN 9073
#define CM_TIF 9074
#define CM_EXIT 9075
#define IDC_MAIN_TEXT 1001
static char g_szClassName[] = "MyWindowClass";
static char dlg_szClassName[] = "DlgWindowClass";
char string[80]="";
char string1[300];
static HINSTANCE g_hInst = NULL;
HWND hwnd;
HWND ed1,ed2;
HMENU meniu = CreateMenu ();
char szFileName[MAX_PATH], fisier[80]="map_ro.in",Nume00[300];
HANDLE hFile;
BOOL bSuccess = FALSE;
OPENFILENAME ofn;
int contor=0;
float XC[1111]={23.647,24.353},
YC[1111]={46.756,45.248};
float xx,yy,XP,YP;
CHAR CSTR[1111][80]={"Cluj-Napoca","Cozia Mt."};
int I, NXP, NYP,tara,t2,NN=2;
long int t1;
#define IDC_MAIN_TEXT 1001
void Plotare()
{
FILE *intrare=fopen("map_ro.in","rt");
fscanf (intrare, "%d\n", &NN);
for (I=0 ;I<NN;I++)
{
fscanf (intrare, "%f %f %[^\n]", &XC[I],&YC[I],&CSTR[I]);//instead of %s we use [^\n] to read until \n
}
fclose (intrare);
metafl ("XWIN");
scrmod ("REVERS");
disini ();
pagera ();
hwfont ();
axspos(500,1850);
axslen(2200,1400);
labdig(1/*-1*/,"xy");//Nr of digits after decimal point
ticks (1,"xy");
name("Longitude","x");
name("Latitude","y");
titlin("Map of Romania",1);
incmrk(-1);
// LABELS ("MAP","xy")
projct ("cyli");
height (25);
grafmp (20.0,30.0,20.0,0.5,43.5,48.5,44.0,0.5);
//world();
// curvmp (XC,YC,NN);//small squares near the label
tara=25;
t1=0;//hatches ..5
t2=9;//color
shdeur (&tara, &t1, &t2, 1);
for (I=0;I<NN;I++)
{
xx=XC[I];yy=YC[I];
pos2pt (xx,yy,&XP,&YP);
NXP=(int)XP+30;
NYP=(int)YP;
symbol (21,NXP-30,NYP);//codul 16 sau 21
messag (CSTR[I] ,NXP,NYP);
}
gridmp (1,1);
height (50);
title();
//MessageBox(NULL,"","",NULL);
disfin();
}
BOOL LoadFile(HWND hEdit, LPSTR pszFileName)
{
bSuccess=TRUE;
hFile = CreateFile(pszFileName, GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, 0, 0);
if(hFile != INVALID_HANDLE_VALUE)
{
DWORD dwFileSize;
dwFileSize = GetFileSize(hFile, NULL);
if(dwFileSize != 0xFFFFFFFF)
{
LPSTR pszFileText;
pszFileText = (LPSTR)GlobalAlloc(GPTR, dwFileSize + 1);
if(pszFileText != NULL)
{
DWORD dwRead;
if(ReadFile(hFile, pszFileText, dwFileSize, &dwRead, NULL))
{
pszFileText[dwFileSize] = 0; // Null terminator
if(SetWindowText(hEdit, pszFileText))
bSuccess = TRUE; // It worked!
}
GlobalFree(pszFileText);
}
}
CloseHandle(hFile);
}
return bSuccess;
}
BOOL SaveFile(HWND hEdit, LPSTR pszFileName)
{
bSuccess = FALSE;
hFile = CreateFile(pszFileName, GENERIC_WRITE, 0, 0,
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
if(hFile != INVALID_HANDLE_VALUE)
{
DWORD dwTextLength;
dwTextLength = GetWindowTextLength(hEdit);
if(dwTextLength > 0)// No need to bother if there's no text.
{
LPSTR pszText;
pszText = (LPSTR)GlobalAlloc(GPTR, dwTextLength + 1);
if(pszText != NULL)
{
if(GetWindowText(hEdit, pszText, dwTextLength + 1))
{
DWORD dwWritten;
if(WriteFile(hFile, pszText, dwTextLength, &dwWritten, NULL))
bSuccess = TRUE;
}
GlobalFree(pszText);
}
}
CloseHandle(hFile);
}
return bSuccess;
}
BOOL DoFileOpenSave(HWND hwnd, BOOL bSave)
{
ZeroMemory(&ofn, sizeof(ofn));
szFileName[0] = 0;
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = hwnd;
ofn.lpstrFilter = "Input files (*.in)\0*.in\0Text files(*.txt)\0*.txt\0\0";
ofn.lpstrFile = szFileName;
ofn.nMaxFile = MAX_PATH;
ofn.lpstrDefExt = "in";
if(bSave)
{
ofn.Flags = OFN_EXPLORER;
//| OFN_PATHMUSTEXIST | OFN_HIDEREADONLY |OFN_OVERWRITEPROMPT;
if(GetSaveFileName(&ofn))
{
if(!SaveFile(GetDlgItem(hwnd, IDC_MAIN_TEXT), szFileName))
{
MessageBox(hwnd, "Save file failed.", "Error",
MB_OK | MB_ICONEXCLAMATION);
return FALSE;
}
}
}
else
{
ofn.Flags = OFN_EXPLORER;// | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
if(GetOpenFileName(&ofn))
{
if(!LoadFile(GetDlgItem(hwnd, IDC_MAIN_TEXT), szFileName))
{
MessageBox(hwnd, "Load of file failed.", "Error",
MB_OK | MB_ICONEXCLAMATION);
return FALSE;
}
}
}
return TRUE;
}
LRESULT CALLBACK WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
char FileName[600]="c:\\temp";
switch(Message)
{
case WM_CREATE:
ed1=CreateWindow("EDIT", "Data for the plot",
WS_CHILD | WS_VISIBLE | WS_HSCROLL | WS_VSCROLL |
ES_MULTILINE |ES_WANTRETURN| ES_AUTOHSCROLL | ES_AUTOVSCROLL, //| ES_OEMCONVERT,
0,0,600, 300,
hwnd, (HMENU)IDC_MAIN_TEXT, g_hInst, NULL);
LoadFile (ed1,fisier);
ed2=CreateWindow("EDIT", "Checking the plotted data",
WS_CHILD | WS_VISIBLE | WS_HSCROLL|
WS_VSCROLL | ES_MULTILINE |
ES_WANTRETURN,//|WS_SYSMENU,
0,300,600, 160,
hwnd, (HMENU)9901, g_hInst, NULL);
ShowWindow(ed2,SW_NORMAL);
SendDlgItemMessage (hwnd, IDC_MAIN_TEXT, WM_SETFONT ,
(WPARAM)GetStockObject(
//DEFAULT_GUI_FONT
SYSTEM_FIXED_FONT
), MAKELPARAM (TRUE, 0));
break ;
break ;
case WM_COMMAND:
switch (LOWORD (wParam) )
{
case CM_OPEN:
DoFileOpenSave (hwnd, FALSE);
break ;
case CM_SAVEAS:
DoFileOpenSave(hwnd, TRUE);
break ;
case CM_EXIT:
PostMessage(hwnd, WM_CLOSE, 0, 0);
break ;
case CM_ABOUT:
MessageBox (NULL, " Plotting Romania's map with labeled localities\n D. Ciurchea 2007"
, "About this program", MB_ICONINFORMATION );
break ;
case CM_TIF://****************SAVING TIFF
{
//****************Fetch the data
ZeroMemory (&ofn,sizeof(ofn));
GetCurrentDirectory ( GetCurrentDirectory (0 ,FileName),FileName);
SetCurrentDirectory (FileName);
FILE *intrare=fopen("map_ro.in","rt");
fscanf (intrare, "%d\n", &NN);
for (I=0 ;I<NN;I++)
fscanf (intrare, "%f %f %[^\n]", &XC[I],&YC[I],&CSTR[I]);//instead of %s we use [^\n] tu tead until \n
fclose (intrare);
//****************Get file name for the image
ofn.hwndOwner=hwnd;
ofn.lStructSize = sizeof(ofn);
ofn.lpstrFile=FileName;
ofn.nMaxFile=10000;
ofn.Flags=OFN_HIDEREADONLY | OFN_EXPLORER | OFN_OVERWRITEPROMPT ;
ofn.lpstrDefExt = "tif";
ofn.lpstrFilter=
"TIFF format image files(*.tif)\0*.tif"
"\0All files (*.*)\0*.*\0\0";
ofn.lpstrTitle = _T("Saving the image in TIFF format");
bSuccess = GetSaveFileName (&ofn);
//******************DISLIN plot of the image on disk in TIFF format
setfil (FileName);
filmod ("count");//or "delete");//about the file on disk
metafl ("TIFF");// metafl ("XWIN");
scrmod ("REVERS");
disini ();
pagera ();
hwfont ();
axspos (500,1850);
axslen (2200,1400);
labdig (1/*-1*/,"xy");
ticks (1,"xy");
name ("Longitude","x");
name ("Latitude","y");
titlin ("Map of Romania",1);
incmrk (-1);
// LABELS ("MAP","xy")
projct ("cyli");
height (25);
grafmp (20.0,30.0,20.0,0.5,43.5,48.5,44.0,0.5);
world();
// curvmp (XC,YC,NN);//associate small squares to the labels
tara=25;//country; Romania=25
t1=0;//hatches ..5
t2=9;//color
shdeur (&tara, &t1, &t2, 1);
for (I=0;I<NN;I++)
{
xx=XC[I];yy=YC[I];
pos2pt (xx,yy,&XP,&YP);
NXP=(int)XP+30;
NYP=(int)YP;
symbol (21,NXP-30,NYP);//code 16 or 21
messag (CSTR[I] ,NXP,NYP);
}
gridmp (1,1);
height (50);
title ();
sprintf (string,"Plot done and Saved\n\nThe path is:\n\n %s",FileName);
MessageBox (NULL,string,"Saving in TIFF format",MB_ICONEXCLAMATION );
SetWindowText (ed2,FileName);
disfin ();
}
break ;
case CM_HELP:
MessageBox (NULL, " In the upper window(work window) the user should write in separate rows:\n\n"
"1. Number of points - i.e. items such as localities - which will be plotted = N\n"
"2. N rows containing: LONGITUDE, LATITUDE folowed by the label, i.e. name of the locality\n\n"
"Program functionality is obtained by clicking the menu items or by using keyboard shortcutsin"
&
"the usual way:\n\t\t<Alt>S for Save\n\t\t<Alt>L for Load\n\t\t<Alt>P for Plot"
"\n\t\t<Alt>H for Help\n\t\t<Alt>A for About\n\t\t<Alt>V for Image saving\n\t\t<Alt>E for Ending program\n\n"
"Obs:\n-----\n- The work window (the upper window) is automatically saved as \'map_ro.in\' in the working folder\n\n"
"-> To end visualization click the mouse right button\n\n"
"-> You may save the image in TIFF format but keeping keep in mind the current working folder \n"
" == WHERE YOU SAVED THE INPUT DATA == a mandatory requirement for a clean work.\n\n"
"·> In case of name repetition in the same folder, the old file is not overwritten but a counter is attached to the first\n"" few characters of the file name\n\n"
"·> After the plot the data used in \'map_ro.in\' are posted in the lower window.\n\n"
"·> Similarly, after saving the image, the path is posted in the lower window for verification\n\n"
"\n\n D. Ciurchea 2007",
"How to use the program", MB_ICONQUESTION);
break ;
case CM_CALCUL:
{
SaveFile(GetDlgItem(hwnd, IDC_MAIN_TEXT), "map_ro.in");
Plotare();
LoadFile(ed2,fisier/*Name fixed as 'map_ro.in'*/);
SetFocus(ed2);
}
break ;
}
break;
case WM_CLOSE:
DestroyWindow(hwnd);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hwnd, Message, wParam, lParam);
}
return 0;
}
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
WNDCLASSEX WndClass;
MSG Msg;
FILE *iesire=fopen("map_ro.in","wt");
fprintf (iesire, "%d\n", NN);
for (I=0 ;I<NN;I++) fprintf (iesire, "%f %f %s\n", XC[I],YC[I],CSTR[I]);
fclose (iesire);
g_hInst = hInstance;
WndClass.cbSize = sizeof(WNDCLASSEX);
WndClass.style = 0;
WndClass.lpfnWndProc = WndProc;
WndClass.cbClsExtra = 0;
WndClass.cbWndExtra = 0;
WndClass.hInstance = g_hInst;
WndClass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
WndClass.hCursor = LoadCursor(NULL, IDC_ARROW);
WndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
WndClass.lpszMenuName = "MAINMENU";
WndClass.lpszClassName = g_szClassName;
WndClass.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
if(!RegisterClassEx(&WndClass))
{
MessageBox(0, "Window Registration Failed!", "Error!",
MB_ICONEXCLAMATION | MB_OK | MB_SYSTEMMODAL);
return 0;
}
hwnd = CreateWindowEx(
WS_EX_CLIENTEDGE,
g_szClassName,
"Plot Romania map with localities",
WS_OVERLAPPEDWINDOW,
0,0,612,512,//CW_USEDEFAULT, CW_USEDEFAULT,CW_USEDEFAULT, 400,
NULL, NULL, g_hInst, NULL);
if(hwnd == NULL)
{
MessageBox(0, "Window Creation Failed!", "Error!",
MB_ICONEXCLAMATION | MB_OK | MB_SYSTEMMODAL);
return 0;
}
AppendMenu (meniu, MF_STRING , CM_OPEN ,"&Load data");
AppendMenu (meniu, MF_STRING , CM_SAVEAS ,"&Save data");
AppendMenu (meniu, MF_STRING , CM_CALCUL ,"&Plot Map");
AppendMenu (meniu, MF_STRING , CM_HELP ,"&HELP");
AppendMenu (meniu, MF_STRING , CM_ABOUT ,"&About");
AppendMenu (meniu, MF_STRING , CM_TIF ,"Sa&ve Map Image");
AppendMenu (meniu, MF_STRING , CM_EXIT ," &END");
SetMenu (hwnd,meniu);
ShowWindow (hwnd, nCmdShow);
UpdateWindow (hwnd);
while ( GetMessage ( &Msg, NULL , 0 , 0 ) )
{
TranslateMessage (&Msg);
DispatchMessage (&Msg);
}
return Msg.wParam;
}
Download program

|